Class Channel

  • All Implemented Interfaces:
    java.lang.Comparable<Channel>
    Direct Known Subclasses:
    ChannelType, ChannelType

    public abstract class Channel
    extends java.lang.Object
    implements java.lang.Comparable<Channel>
    An update channel, e.g. Stable or Beta. Channels are ordered from more to less stable.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_ID
      The default channel is the most stable.
    • Constructor Summary

      Constructors 
      Constructor Description
      Channel()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(Channel o)  
      static Channel create​(int id)
      Create a new Channel with the specified ID.
      boolean equals​(java.lang.Object obj)  
      java.lang.String getDisplayName()
      Gets the display name for this channel.
      abstract java.lang.String getId()
      Gets the string ID for this channel, in the format channel-N.
      protected abstract java.lang.String getValue()
      Gets the (possibly null) display name for this channel.
      int hashCode()  
      abstract void setId​(java.lang.String id)
      Sets the string ID for this channel.
      abstract void setValue​(java.lang.String displayName)
      Sets the displayName for this channel.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_ID

        public static final int DEFAULT_ID
        The default channel is the most stable.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Channel

        public Channel()
    • Method Detail

      • create

        @NonNull
        public static Channel create​(int id)
        Create a new Channel with the specified ID.
        Parameters:
        id - The id of the channel. If this channel will ever be marshalled the value must be between 0 and 9 or the xml will fail validation.
      • getValue

        @Nullable
        protected abstract java.lang.String getValue()
        Gets the (possibly null) display name for this channel.
      • setValue

        public abstract void setValue​(@Nullable
                                      java.lang.String displayName)
        Sets the displayName for this channel.
      • getDisplayName

        @NonNull
        public java.lang.String getDisplayName()
        Gets the display name for this channel. If none is specified, the id (in the format channel-N) is returned.
      • getId

        @NonNull
        public abstract java.lang.String getId()
        Gets the string ID for this channel, in the format channel-N.
      • setId

        public abstract void setId​(@NonNull
                                   java.lang.String id)
        Sets the string ID for this channel. Must be in the form "channel-N".
      • compareTo

        public int compareTo​(Channel o)
        Specified by:
        compareTo in interface java.lang.Comparable<Channel>
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object