public abstract class AndroidTargetHash
extends java.lang.Object
IAndroidTarget.hashString()
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADD_ON_FORMAT
String to compute hash for add-on targets.
|
static java.lang.String |
PLATFORM_HASH_PREFIX
Prefix used to build hash strings for platform targets
|
Constructor and Description |
---|
AndroidTargetHash() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getAddonHashString(java.lang.String addonVendorDisplay,
java.lang.String addonNameDisplay,
com.android.sdklib.AndroidVersion version)
Returns the hash string for a given add-on.
|
static com.android.sdklib.AndroidVersion |
getAddOnVersion(java.lang.String hashString) |
static java.lang.String |
getPlatformHashString(com.android.sdklib.AndroidVersion version)
Returns the hash string for a given platform version.
|
static com.android.sdklib.AndroidVersion |
getPlatformVersion(java.lang.String hashString)
Returns the
AndroidVersion for the given hash string,
if it represents a platform. |
static java.lang.String |
getTargetHashString(IAndroidTarget target)
Returns the hash string for a given target (add-on or platform.)
|
static com.android.sdklib.AndroidVersion |
getVersionFromHash(java.lang.String hashString)
Gets the API level from a hash string, either a platform version or add-on version.
|
static boolean |
isPlatform(java.lang.String hashString)
Given a hash string, indicates whether this is a platform hash string.
|
public static final java.lang.String PLATFORM_HASH_PREFIX
public static final java.lang.String ADD_ON_FORMAT
vendor:name:apiVersion
. @NonNull public static java.lang.String getPlatformHashString(@NonNull com.android.sdklib.AndroidVersion version)
version
- A non-null platform version.@Nullable public static com.android.sdklib.AndroidVersion getPlatformVersion(@NonNull java.lang.String hashString)
AndroidVersion
for the given hash string,
if it represents a platform. If the hash string represents a preview platform,
the returned AndroidVersion
will have an unknown API level (set to 1
or a known matching API level.)hashString
- the hash string (e.g. "android-19" or "android-CUPCAKE")
or a pure API level for convenience (e.g. "19" instead of the proper "android-19")@Nullable public static com.android.sdklib.AndroidVersion getAddOnVersion(@NonNull java.lang.String hashString)
@Nullable public static com.android.sdklib.AndroidVersion getVersionFromHash(@NonNull java.lang.String hashString)
public static java.lang.String getAddonHashString(@NonNull java.lang.String addonVendorDisplay, @NonNull java.lang.String addonNameDisplay, @NonNull com.android.sdklib.AndroidVersion version)
addonVendorDisplay
- A non-null vendor. When using an IdDisplay
source,
this parameter should be the IdDisplay.getDisplay()
.addonNameDisplay
- A non-null add-on name. When using an IdDisplay
source,
this parameter should be the IdDisplay.getDisplay()
.version
- A non-null platform version (the addon's base platform version)public static java.lang.String getTargetHashString(@NonNull IAndroidTarget target)
target
- A non-null target.public static boolean isPlatform(@NonNull java.lang.String hashString)
hashString
- The hash string to test.