public abstract class ResourceQualifier extends java.lang.Object implements java.lang.Comparable<ResourceQualifier>
Constructor and Description |
---|
ResourceQualifier() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
checkAndSet(java.lang.String value,
FolderConfiguration config)
Check if the value is valid for this qualifier, and if so sets the value into a Folder
Configuration.
|
int |
compareTo(ResourceQualifier o) |
boolean |
deprecated()
Whether this qualifier is deprecated.
|
abstract boolean |
equals(java.lang.Object object)
Returns
true if both objects are equal. |
abstract java.lang.String |
getFolderSegment()
Returns a string formatted to be used in a folder name.
|
abstract java.lang.String |
getLongDisplayValue()
Returns a string formatted for display purpose.
|
abstract java.lang.String |
getName()
Returns the human readable name of the qualifier.
|
ResourceQualifier |
getNullQualifier()
Returns the qualifier that can be used in
isBetterMatchThan(ResourceQualifier,
ResourceQualifier) when no qualifier is present in the config. |
abstract java.lang.String |
getShortDisplayValue()
Returns a string formatted for display purpose.
|
abstract java.lang.String |
getShortName()
Returns a shorter human readable name for the qualifier.
|
abstract boolean |
hasFakeValue()
Returns whether the qualifier has a fake value.
|
abstract int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isBetterMatchThan(ResourceQualifier compareTo,
ResourceQualifier reference)
Returns true if the receiver (this) is a better match for the given
reference than
the given compareTo comparable. |
boolean |
isMatchFor(ResourceQualifier qualifier)
Returns whether the given qualifier is a match for the receiver.
|
abstract boolean |
isValid()
Returns whether the qualifier has a valid filter value.
|
static boolean |
isValid(ResourceQualifier qualifier) |
abstract int |
since()
Returns the API level when this qualifier was added to Android.
|
java.lang.String |
toString() |
public abstract java.lang.String getName()
public abstract java.lang.String getShortName()
getName()
public abstract int since()
public boolean deprecated()
public abstract boolean isValid()
public abstract boolean hasFakeValue()
public abstract boolean checkAndSet(java.lang.String value, FolderConfiguration config)
value
- The value to check and set. Must not be null.config
- The folder configuration to receive the value. Must not be null.public abstract java.lang.String getFolderSegment()
public ResourceQualifier getNullQualifier()
isBetterMatchThan(ResourceQualifier,
ResourceQualifier)
when no qualifier is present in the config.
null has a special meaning when trying to match the best config (it's the worst qualifier,
unless not other alternative matches). If a qualifier type has a different definition of best
in regards to the null qualifier, this method should be subclassed and a special value should
be returned from here, which can then be used to call (ResourceQualifier, ResourceQualifier)
which can implement the custom logic.public boolean isMatchFor(ResourceQualifier qualifier)
equals(Object)
.
Children class that re-implements this must implement (ResourceQualifier, ResourceQualifier)
too.qualifier
- the reference qualifierpublic boolean isBetterMatchThan(@Nullable ResourceQualifier compareTo, @NonNull ResourceQualifier reference)
reference
than
the given compareTo
comparable.compareTo
- The ResourceQualifier
to compare to.reference
- The reference qualifier value for which the match is (from phone's
folderConfig).public java.lang.String toString()
toString
in class java.lang.Object
public abstract java.lang.String getShortDisplayValue()
public abstract java.lang.String getLongDisplayValue()
public abstract boolean equals(java.lang.Object object)
true
if both objects are equal.
This is declared as abstract to force children classes to implement it.equals
in class java.lang.Object
public abstract int hashCode()
hashCode
in class java.lang.Object
public final int compareTo(@NonNull ResourceQualifier o)
compareTo
in interface java.lang.Comparable<ResourceQualifier>
public static boolean isValid(@Nullable ResourceQualifier qualifier)