Bladeren bron

Tidy up DisplayProperty a bit.

pull/519/head
Chris Smith 9 jaren geleden
bovenliggende
commit
5ed767ba72
1 gewijzigde bestanden met toevoegingen van 7 en 4 verwijderingen
  1. 7
    4
      src/com/dmdirc/events/DisplayProperty.java

+ 7
- 4
src/com/dmdirc/events/DisplayProperty.java Bestand weergeven

@@ -27,13 +27,16 @@ import com.dmdirc.util.colours.Colour;
27 27
 /**
28 28
  * Describes a property that may be set on a {@link DisplayableEvent} to affect its display.
29 29
  */
30
-public final class DisplayProperty<T> {
30
+@SuppressWarnings("UnusedDeclaration") // Generic type used for compile-time validation only
31
+public interface DisplayProperty<T> {
31 32
 
32 33
     /** The foreground colour of text relating to the event. */
33
-    public static final DisplayProperty<Colour> FOREGROUND_COLOUR = new DisplayProperty<>();
34
+    DisplayProperty<Colour> FOREGROUND_COLOUR = new DisplayPropertyImpl<>();
34 35
     /** The background colour of text relating to the event. */
35
-    public static final DisplayProperty<Colour> BACKGROUND_COLOUR = new DisplayProperty<>();
36
+    DisplayProperty<Colour> BACKGROUND_COLOUR = new DisplayPropertyImpl<>();
36 37
     /** Whether to suppress display of the event. */
37
-    public static final DisplayProperty<Void> DO_NOT_DISPLAY = new DisplayProperty<>();
38
+    DisplayProperty<Void> DO_NOT_DISPLAY = new DisplayPropertyImpl<>();
39
+
40
+    final class DisplayPropertyImpl<T> implements DisplayProperty<T> {}
38 41
 
39 42
 }

Laden…
Annuleren
Opslaan