Package com.android.repository.api
Class Channel
- java.lang.Object
-
- com.android.repository.api.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 intDEFAULT_IDThe 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 intcompareTo(Channel o)static Channelcreate(int id)Create a newChannelwith the specified ID.booleanequals(java.lang.Object obj)java.lang.StringgetDisplayName()Gets the display name for this channel.abstract java.lang.StringgetId()Gets the string ID for this channel, in the formatchannel-N.protected abstract java.lang.StringgetValue()Gets the (possibly null) display name for this channel.inthashCode()abstract voidsetId(java.lang.String id)Sets the string ID for this channel.abstract voidsetValue(java.lang.String displayName)Sets the displayName for this channel.
-
-
-
Field Detail
-
DEFAULT_ID
public static final int DEFAULT_ID
The default channel is the most stable.- See Also:
- Constant Field Values
-
-
Method Detail
-
create
@NonNull public static Channel create(int id)
Create a newChannelwith 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 formatchannel-N) is returned.
-
getId
@NonNull public abstract java.lang.String getId()
Gets the string ID for this channel, in the formatchannel-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:
compareToin interfacejava.lang.Comparable<Channel>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-