Class PkgDesc

  • All Implemented Interfaces:
    IPkgDesc, java.lang.Comparable<IPkgDesc>
    Direct Known Subclasses:
    PkgDescExtra

    @Deprecated
    public class PkgDesc
    extends java.lang.Object
    implements IPkgDesc
    Deprecated.
    This is part of the old SDK manager framework. Use AndroidSdkHandler/RepoManager and associated classes instead.
    PkgDesc keeps information on individual SDK packages (both local or remote packages definitions.)
    Packages have different attributes depending on their type.

    To create a new PkgDesc, use one of the package-specific constructors provided here.

    To query packages capabilities, rely on getType() and the PkgDesc.hasXxx() methods provided in the base PkgDesc.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PkgDesc​(PkgType type, com.android.repository.api.License license, java.lang.String listDisplay, java.lang.String descriptionShort, java.lang.String descriptionUrl, boolean isObsolete, com.android.repository.Revision revision, com.android.sdklib.AndroidVersion androidVersion, java.lang.String path, IdDisplay tag, IdDisplay vendor, com.android.repository.Revision minToolsRev, com.android.repository.Revision minPlatformToolsRev, PkgDesc.IIsUpdateFor customIsUpdateFor, PkgDesc.IGetPath customPath, IdDisplay name)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      int compareTo​(IPkgDesc o)
      Deprecated.
      Compares this descriptor to another one.
      boolean equals​(java.lang.Object obj)
      Deprecated.
       
      com.android.sdklib.AndroidVersion getAndroidVersion()
      Deprecated.
      Returns the package's AndroidVersion or null.
      java.lang.String getBaseInstallId()
      Deprecated.
      Returns a stable string id that can be used to reference this package, which excludes the preview suffix.
      java.nio.file.Path getCanonicalInstallFolder​(java.nio.file.Path sdkLocation)
      Deprecated.
      Returns the canonical location where such a package would be installed.
      java.lang.String getDescriptionShort()
      Deprecated.
       
      java.lang.String getDescriptionUrl()
      Deprecated.
       
      java.lang.String getInstallId()
      Deprecated.
      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.
      com.android.repository.api.License getLicense()
      Deprecated.
       
      java.lang.String getListDescription()
      Deprecated.
       
      java.lang.String getListDisplay()
      Deprecated.
      Returns the list-display meta data of this package.
      com.android.repository.Revision getMinPlatformToolsRev()
      Deprecated.
      Returns the package's min-platform-tools-rev or null.
      com.android.repository.Revision getMinToolsRev()
      Deprecated.
      Returns the package's min-tools-rev or null.
      IdDisplay getName()
      Deprecated.
       
      java.lang.String getPath()
      Deprecated.
      Returns the package's path string or null.
      com.android.repository.Revision getRevision()
      Deprecated.
      Returns the package's Revision.
      IdDisplay getTag()
      Deprecated.
      Returns the package's tag id-display tuple or null.
      PkgType getType()
      Deprecated.
      Returns the type of the package.
      IdDisplay getVendor()
      Deprecated.
      Returns the package's vendor-id string or null.
      boolean hasAndroidVersion()
      Deprecated.
       
      int hashCode()
      Deprecated.
       
      boolean hasMinPlatformToolsRev()
      Deprecated.
       
      boolean hasMinToolsRev()
      Deprecated.
       
      boolean hasName()
      Deprecated.
       
      boolean hasPath()
      Deprecated.
       
      boolean hasTag()
      Deprecated.
       
      boolean hasVendor()
      Deprecated.
       
      boolean isObsolete()
      Deprecated.
       
      boolean isPreview()
      Deprecated.
       
      boolean isUpdateFor​(IPkgDesc existingDesc)
      Deprecated.
      Computes the most general case of isUpdateFor(IPkgDesc).
      boolean isUpdateFor​(IPkgDesc existingDesc, com.android.repository.Revision.PreviewComparison previewComparison)
      Deprecated.
      Indicates whether this package descriptor is an update for the given existing descriptor, using the given comparison method.
      protected java.lang.String patternReplaceImpl​(java.lang.String result)
      Deprecated.
       
      java.lang.String toString()
      Deprecated.
      String representation for debugging purposes.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PkgDesc

        protected PkgDesc​(@NonNull
                          PkgType type,
                          @Nullable
                          com.android.repository.api.License license,
                          @Nullable
                          java.lang.String listDisplay,
                          @Nullable
                          java.lang.String descriptionShort,
                          @Nullable
                          java.lang.String descriptionUrl,
                          boolean isObsolete,
                          @Nullable
                          com.android.repository.Revision revision,
                          @Nullable
                          com.android.sdklib.AndroidVersion androidVersion,
                          @Nullable
                          java.lang.String path,
                          @Nullable
                          IdDisplay tag,
                          @Nullable
                          IdDisplay vendor,
                          @Nullable
                          com.android.repository.Revision minToolsRev,
                          @Nullable
                          com.android.repository.Revision minPlatformToolsRev,
                          @Nullable
                          PkgDesc.IIsUpdateFor customIsUpdateFor,
                          @Nullable
                          PkgDesc.IGetPath customPath,
                          @Nullable
                          IdDisplay name)
        Deprecated.
    • Method Detail

      • getType

        @NonNull
        public PkgType getType()
        Deprecated.
        Description copied from interface: IPkgDesc
        Returns the type of the package.
        Specified by:
        getType in interface IPkgDesc
        Returns:
        Returns one of the PkgType constants.
      • getListDisplay

        @Nullable
        public java.lang.String getListDisplay()
        Deprecated.
        Description copied from interface: IPkgDesc
        Returns the list-display meta data of this package.
        Specified by:
        getListDisplay in interface IPkgDesc
        Returns:
        The list-display data, if available, or null.
      • getDescriptionShort

        @Nullable
        public java.lang.String getDescriptionShort()
        Deprecated.
        Specified by:
        getDescriptionShort in interface IPkgDesc
      • getDescriptionUrl

        @Nullable
        public java.lang.String getDescriptionUrl()
        Deprecated.
        Specified by:
        getDescriptionUrl in interface IPkgDesc
      • getLicense

        @Nullable
        public com.android.repository.api.License getLicense()
        Deprecated.
        Specified by:
        getLicense in interface IPkgDesc
      • isObsolete

        public boolean isObsolete()
        Deprecated.
        Specified by:
        isObsolete in interface IPkgDesc
      • hasAndroidVersion

        public final boolean hasAndroidVersion()
        Deprecated.
        Specified by:
        hasAndroidVersion in interface IPkgDesc
      • hasPath

        public final boolean hasPath()
        Deprecated.
        Specified by:
        hasPath in interface IPkgDesc
      • hasTag

        public final boolean hasTag()
        Deprecated.
        Specified by:
        hasTag in interface IPkgDesc
      • hasVendor

        public boolean hasVendor()
        Deprecated.
        Specified by:
        hasVendor in interface IPkgDesc
      • hasName

        public boolean hasName()
        Deprecated.
      • hasMinToolsRev

        public final boolean hasMinToolsRev()
        Deprecated.
        Specified by:
        hasMinToolsRev in interface IPkgDesc
      • getRevision

        @NonNull
        public final com.android.repository.Revision getRevision()
        Deprecated.
        Description copied from interface: IPkgDesc
        Returns the package's Revision.
        Specified by:
        getRevision in interface IPkgDesc
      • getAndroidVersion

        @Nullable
        public com.android.sdklib.AndroidVersion getAndroidVersion()
        Deprecated.
        Description copied from interface: IPkgDesc
        Returns the package's AndroidVersion or null.
        Specified by:
        getAndroidVersion in interface IPkgDesc
        Returns:
        A non-null value if IPkgDesc.hasAndroidVersion() is true; otherwise a null value.
      • isPreview

        public boolean isPreview()
        Deprecated.
        Specified by:
        isPreview in interface IPkgDesc
        Returns:
        True if the revision of this package is a preview.
      • getTag

        @Nullable
        public IdDisplay getTag()
        Deprecated.
        Description copied from interface: IPkgDesc
        Returns the package's tag id-display tuple or null.
        Specified by:
        getTag in interface IPkgDesc
        Returns:
        A non-null tag if IPkgDesc.hasTag() is true; otherwise a null value.
      • getVendor

        @Nullable
        public IdDisplay getVendor()
        Deprecated.
        Description copied from interface: IPkgDesc
        Returns the package's vendor-id string or null.
        Specified by:
        getVendor in interface IPkgDesc
        Returns:
        A non-null value if IPkgDesc.hasVendor() is true; otherwise a null value.
      • getMinToolsRev

        @Nullable
        public com.android.repository.Revision getMinToolsRev()
        Deprecated.
        Description copied from interface: IPkgDesc
        Returns the package's min-tools-rev or null.
        Specified by:
        getMinToolsRev in interface IPkgDesc
        Returns:
        A non-null value if IPkgDesc.hasMinToolsRev() is true; otherwise a null value.
      • getMinPlatformToolsRev

        @Nullable
        public com.android.repository.Revision getMinPlatformToolsRev()
        Deprecated.
        Description copied from interface: IPkgDesc
        Returns the package's min-platform-tools-rev or null.
        Specified by:
        getMinPlatformToolsRev in interface IPkgDesc
        Returns:
        A non-null value if IPkgDesc.hasMinPlatformToolsRev() is true; otherwise null.
      • getInstallId

        public java.lang.String getInstallId()
        Deprecated.
        Description copied from interface: IPkgDesc
        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.
        Specified by:
        getInstallId in interface IPkgDesc
      • getBaseInstallId

        public java.lang.String getBaseInstallId()
        Deprecated.
        Description copied from interface: IPkgDesc
        Returns a stable string id that can be used to reference this package, which excludes the preview suffix.
        Specified by:
        getBaseInstallId in interface IPkgDesc
      • getCanonicalInstallFolder

        @NonNull
        public java.nio.file.Path getCanonicalInstallFolder​(@NonNull
                                                            java.nio.file.Path sdkLocation)
        Deprecated.
        Description copied from interface: IPkgDesc
        Returns the canonical location where such a package would be installed.
        Specified by:
        getCanonicalInstallFolder in interface IPkgDesc
        Parameters:
        sdkLocation - The root of the SDK.
        Returns:
        the canonical location where such a package would be installed.
      • isUpdateFor

        public boolean isUpdateFor​(@NonNull
                                   IPkgDesc existingDesc)
        Deprecated.
        Computes the most general case of isUpdateFor(IPkgDesc). Individual package types use this and complement with their own specific cases as needed.
        Specified by:
        isUpdateFor in interface IPkgDesc
        Parameters:
        existingDesc - A non-null package descriptor to compare with.
        Returns:
        True if this package descriptor would generally update the given one.
      • isUpdateFor

        public boolean isUpdateFor​(@NonNull
                                   IPkgDesc existingDesc,
                                   @NonNull
                                   com.android.repository.Revision.PreviewComparison previewComparison)
        Deprecated.
        Description copied from interface: IPkgDesc
        Indicates whether this package descriptor is an update for the given existing descriptor, using the given comparison method.
        Specified by:
        isUpdateFor in interface IPkgDesc
        Parameters:
        existingDesc - A non-null existing descriptor.
        previewComparison - The Revision.PreviewComparison method to use when comparing the packages.
        Returns:
        True if this package is an update for the given one.
      • compareTo

        public int compareTo​(@NonNull
                             IPkgDesc o)
        Deprecated.
        Compares this descriptor to another one. All fields must match for equality.

        This is must not be used an indication that a package is a suitable update for another one. The comparison order is however suitable for sorting packages for display purposes.

        Specified by:
        compareTo in interface java.lang.Comparable<IPkgDesc>
      • getListDescription

        @NonNull
        public java.lang.String getListDescription()
        Deprecated.
        Specified by:
        getListDescription in interface IPkgDesc
      • patternReplaceImpl

        protected java.lang.String patternReplaceImpl​(java.lang.String result)
        Deprecated.
      • toString

        public java.lang.String toString()
        Deprecated.
        String representation for debugging purposes.
        Overrides:
        toString in class java.lang.Object
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Deprecated.
        Overrides:
        equals in class java.lang.Object