com.android.sdklib.repositoryv2
Class IdDisplay

java.lang.Object
  extended by com.android.sdklib.repositoryv2.IdDisplay
All Implemented Interfaces:
java.lang.Comparable<IdDisplay>
Direct Known Subclasses:
IdDisplayType

public abstract class IdDisplay
extends java.lang.Object
implements java.lang.Comparable<IdDisplay>

A string with both user-friendly and easily-parsed versions. Contains stubs to be overridden by xjc-generated classes.


Constructor Summary
IdDisplay()
           
 
Method Summary
 int compareTo(IdDisplay o)
           
static IdDisplay create(java.lang.String id, java.lang.String display)
           
 boolean equals(java.lang.Object o)
           
abstract  java.lang.String getDisplay()
          Gets the user-friendly version of the string.
abstract  java.lang.String getId()
          Gets the machine-friendly version of the string.
 int hashCode()
           
static java.lang.String idToDisplay(java.lang.String id)
          Computes a display-friendly tag string based on the id.
abstract  void setDisplay(java.lang.String display)
          Sets the user-friendly version of the string.
abstract  void setId(java.lang.String id)
          Sets the machine-friendly version of the string.
 java.lang.String toString()
          Returns a string representation for *debug* purposes only, not for UI display.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdDisplay

public IdDisplay()
Method Detail

create

public static IdDisplay create(@NonNull
                               java.lang.String id,
                               @NonNull
                               java.lang.String display)

setId

public abstract void setId(@NonNull
                           java.lang.String id)
Sets the machine-friendly version of the string.


setDisplay

public abstract void setDisplay(@NonNull
                                java.lang.String display)
Sets the user-friendly version of the string.


getId

@NonNull
public abstract java.lang.String getId()
Gets the machine-friendly version of the string.


getDisplay

@NonNull
public abstract java.lang.String getDisplay()
Gets the user-friendly version of the string.


compareTo

public int compareTo(IdDisplay o)
Specified by:
compareTo in interface java.lang.Comparable<IdDisplay>

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

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

toString

public java.lang.String toString()
Returns a string representation for *debug* purposes only, not for UI display.

Overrides:
toString in class java.lang.Object

idToDisplay

@NonNull
public static java.lang.String idToDisplay(@NonNull
                                                   java.lang.String id)
Computes a display-friendly tag string based on the id. This is typically used when there's no display attribute.

Parameters:
id - A non-null id to sanitize for display.
Returns:
The id with all non-alphanum symbols replaced by spaces and trimmed.