com.android.sdklib.repository.descriptors
Interface IPkgDesc

All Superinterfaces:
java.lang.Comparable<IPkgDesc>, IListDescription, IPkgCapabilities
All Known Subinterfaces:
IPkgDescAddon, IPkgDescExtra
All Known Implementing Classes:
PkgDesc, PkgDescExtra

public interface IPkgDesc
extends java.lang.Comparable<IPkgDesc>, IPkgCapabilities, IListDescription

IPkgDesc keeps information on individual SDK packages (both local or remote packages definitions.)
Packages have different attributes depending on their type.

To create a new IPkgDesc, use one of the package-specific constructors provided by PkgDesc.Builder.newXxx().

To query packages capabilities, rely on getType() and the IPkgDesc.hasXxx() methods provided by IPkgDesc.


Method Summary
 AndroidVersion getAndroidVersion()
          Returns the package's AndroidVersion or null.
 java.lang.String getBaseInstallId()
          Returns a stable string id that can be used to reference this package, which excludes the preview suffix.
 java.io.File getCanonicalInstallFolder(java.io.File sdkLocation)
          Returns the canonical location where such a package would be installed.
 java.lang.String getDescriptionShort()
           
 java.lang.String getDescriptionUrl()
           
 FullRevision getFullRevision()
          Returns the package's FullRevision or null.
 java.lang.String getInstallId()
          Returns a stable string id that can be used to reference this package, including a suffix indicating that this package is a preview if it is.
 License getLicense()
           
 java.lang.String getListDisplay()
          Returns the list-display meta data of this package.
 MajorRevision getMajorRevision()
          Returns the package's MajorRevision or null.
 FullRevision getMinPlatformToolsRev()
          Returns the package's min-platform-tools-rev or null.
 FullRevision getMinToolsRev()
          Returns the package's min-tools-rev or null.
 java.lang.String getPath()
          Returns the package's path string or null.
 PreciseRevision getPreciseRevision()
          Returns the package's revision or null.
 IdDisplay getTag()
          Returns the package's tag id-display tuple or null.
 PkgType getType()
          Returns the type of the package.
 IdDisplay getVendor()
          Returns the package's vendor-id string or null.
 boolean isObsolete()
           
 boolean isPreview()
           
 boolean isUpdateFor(IPkgDesc existingDesc)
          Indicates whether this package descriptor is an update for the given existing descriptor.
 boolean isUpdateFor(IPkgDesc existingDesc, FullRevision.PreviewComparison previewComparison)
          Indicates whether this package descriptor is an update for the given existing descriptor, using the given comparison method.
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.android.sdklib.repository.descriptors.IPkgCapabilities
hasAndroidVersion, hasFullRevision, hasMajorRevision, hasMinPlatformToolsRev, hasMinToolsRev, hasPath, hasTag, hasVendor
 
Methods inherited from interface com.android.sdklib.repository.IListDescription
getListDescription
 

Method Detail

getType

@NonNull
PkgType getType()
Returns the type of the package.

Returns:
Returns one of the PkgType constants.

getListDisplay

@Nullable
java.lang.String getListDisplay()
Returns the list-display meta data of this package.

Returns:
The list-display data, if available, or null.

getDescriptionShort

@Nullable
java.lang.String getDescriptionShort()

getDescriptionUrl

@Nullable
java.lang.String getDescriptionUrl()

getLicense

@Nullable
License getLicense()

isObsolete

boolean isObsolete()

getFullRevision

@Nullable
FullRevision getFullRevision()
Returns the package's FullRevision or null.

Returns:
A non-null value if IPkgCapabilities.hasFullRevision() is true; otherwise a null value.

getMajorRevision

@Nullable
MajorRevision getMajorRevision()
Returns the package's MajorRevision or null.

Returns:
A non-null value if IPkgCapabilities.hasMajorRevision() is true; otherwise a null value.

getPreciseRevision

@NonNull
PreciseRevision getPreciseRevision()
Returns the package's revision or null. This will come from the FullRevision or MajorRevision, with the precision set as appropriate.

Returns:
A representation of getMajorRevision() or getFullRevision(), depending on which one exists.

getAndroidVersion

@Nullable
AndroidVersion getAndroidVersion()
Returns the package's AndroidVersion or null.

Returns:
A non-null value if IPkgCapabilities.hasAndroidVersion() is true; otherwise a null value.

getPath

@Nullable
java.lang.String getPath()
Returns the package's path string or null.

For PkgType.PKG_SYS_IMAGE, the path is the system-image ABI.
For PkgType.PKG_PLATFORM, the path is the platform hash string.
For PkgType.PKG_ADDON, the path is the platform hash string.
For PkgType.PKG_EXTRA, the path is the extra-path string.

Returns:
A non-null value if IPkgCapabilities.hasPath() is true; otherwise a null value.

getTag

@Nullable
IdDisplay getTag()
Returns the package's tag id-display tuple or null.

Returns:
A non-null tag if IPkgCapabilities.hasTag() is true; otherwise a null value.

getVendor

@Nullable
IdDisplay getVendor()
Returns the package's vendor-id string or null.

Returns:
A non-null value if IPkgCapabilities.hasVendor() is true; otherwise a null value.

getMinToolsRev

@Nullable
FullRevision getMinToolsRev()
Returns the package's min-tools-rev or null.

Returns:
A non-null value if IPkgCapabilities.hasMinToolsRev() is true; otherwise a null value.

getMinPlatformToolsRev

@Nullable
FullRevision getMinPlatformToolsRev()
Returns the package's min-platform-tools-rev or null.

Returns:
A non-null value if IPkgCapabilities.hasMinPlatformToolsRev() is true; otherwise null.

isUpdateFor

boolean isUpdateFor(@NonNull
                    IPkgDesc existingDesc)
Indicates whether this package descriptor is an update for the given existing descriptor. Preview versions are never considered updates for non- previews, and vice versa.

Parameters:
existingDesc - A non-null existing descriptor.
Returns:
True if this package is an update for the given one.

isUpdateFor

boolean isUpdateFor(@NonNull
                    IPkgDesc existingDesc,
                    @NonNull
                    FullRevision.PreviewComparison previewComparison)
Indicates whether this package descriptor is an update for the given existing descriptor, using the given comparison method.

Parameters:
existingDesc - A non-null existing descriptor.
previewComparison - The FullRevision.PreviewComparison method to use when comparing the packages.
Returns:
True if this package is an update for the given one.

getInstallId

@NonNull
java.lang.String getInstallId()
Returns a stable string id that can be used to reference this package, including a suffix indicating that this package is a preview if it is.


getBaseInstallId

java.lang.String getBaseInstallId()
Returns a stable string id that can be used to reference this package, which excludes the preview suffix.


getCanonicalInstallFolder

@NonNull
java.io.File getCanonicalInstallFolder(@NonNull
                                               java.io.File sdkLocation)
Returns the canonical location where such a package would be installed.

Parameters:
sdkLocation - The root of the SDK.
Returns:
the canonical location where such a package would be installed.

isPreview

boolean isPreview()
Returns:
True if the revision of this package is a preview.