public final class DensityQualifier extends EnumBasedResourceQualifier
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
| Constructor and Description |
|---|
DensityQualifier() |
DensityQualifier(com.android.resources.Density value) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
com.android.resources.ResourceEnum |
getEnumValue() |
java.lang.String |
getName()
Returns the human readable name of the qualifier.
|
DensityQualifier |
getNullQualifier()
Returns the qualifier that can be used in
ResourceQualifier.isBetterMatchThan(ResourceQualifier,
ResourceQualifier) when no qualifier is present in the config. |
java.lang.String |
getShortName()
Returns a shorter human readable name for the qualifier.
|
com.android.resources.Density |
getValue() |
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.
|
boolean |
isValid()
Returns whether the qualifier has a valid filter value.
|
int |
since()
Returns the API level when this qualifier was added to Android.
|
equals, getFolderSegment, getLongDisplayValue, getShortDisplayValue, hasFakeValue, hashCodecompareTo, deprecated, isValid, toStringpublic static final java.lang.String NAME
public DensityQualifier()
public DensityQualifier(@NonNull
com.android.resources.Density value)
public com.android.resources.Density getValue()
public com.android.resources.ResourceEnum getEnumValue()
getEnumValue in class EnumBasedResourceQualifierpublic java.lang.String getName()
ResourceQualifiergetName in class ResourceQualifierpublic java.lang.String getShortName()
ResourceQualifiergetShortName in class ResourceQualifierResourceQualifier.getName()public int since()
ResourceQualifiersince in class ResourceQualifierpublic boolean checkAndSet(java.lang.String value,
FolderConfiguration config)
ResourceQualifiercheckAndSet in class ResourceQualifiervalue - The value to check and set. Must not be null.config - The folder configuration to receive the value. Must not be null.public boolean isValid()
ResourceQualifierisValid in class EnumBasedResourceQualifierpublic DensityQualifier getNullQualifier()
ResourceQualifierResourceQualifier.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.getNullQualifier in class ResourceQualifierpublic boolean isMatchFor(ResourceQualifier qualifier)
ResourceQualifierResourceQualifier.equals(Object).
Children class that re-implements this must implement (ResourceQualifier, ResourceQualifier) too.isMatchFor in class ResourceQualifierqualifier - the reference qualifierpublic boolean isBetterMatchThan(@Nullable
ResourceQualifier compareTo,
@NonNull
ResourceQualifier reference)
ResourceQualifierreference than
the given compareTo comparable.isBetterMatchThan in class ResourceQualifiercompareTo - The ResourceQualifier to compare to.reference - The reference qualifier value for which the match is (from phone's
folderConfig).