Package com.android.repository.api
Class UpdatablePackage
- java.lang.Object
-
- com.android.repository.api.UpdatablePackage
-
- All Implemented Interfaces:
java.lang.Comparable<UpdatablePackage>
public class UpdatablePackage extends java.lang.Object implements java.lang.Comparable<UpdatablePackage>
Represents a (revisionless) package, either local, remote, or both. If both a local and remote package are specified, they should represent exactly the same package, excepting the revision. That is, the result of installing the remote package should be (a possibly updated version of) the local package.
-
-
Constructor Summary
Constructors Constructor Description UpdatablePackage(LocalPackage localPackage)UpdatablePackage(LocalPackage localPackage, RemotePackage remotePackage)UpdatablePackage(RemotePackage remotePackage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(UpdatablePackage o)LocalPackagegetLocal()java.lang.StringgetPath()RemotePackagegetRemote()RepoPackagegetRepresentative()Gets aRepoPackage(either local or remote) corresponding to this updatable package.booleanhasLocal()booleanhasRemote()booleanisUpdate()voidsetRemote(RemotePackage remote)Sets the remote package for thisUpdatablePackage.
-
-
-
Constructor Detail
-
UpdatablePackage
public UpdatablePackage(@NonNull LocalPackage localPackage)
-
UpdatablePackage
public UpdatablePackage(@NonNull RemotePackage remotePackage)
-
UpdatablePackage
public UpdatablePackage(@NonNull LocalPackage localPackage, @NonNull RemotePackage remotePackage)
-
-
Method Detail
-
setRemote
public void setRemote(@NonNull RemotePackage remote)Sets the remote package for thisUpdatablePackage.
-
getLocal
@Nullable public LocalPackage getLocal()
-
getRemote
@Nullable public RemotePackage getRemote()
-
hasRemote
public boolean hasRemote()
-
hasLocal
public boolean hasLocal()
-
compareTo
public int compareTo(@NonNull UpdatablePackage o)- Specified by:
compareToin interfacejava.lang.Comparable<UpdatablePackage>
-
getRepresentative
@NonNull public RepoPackage getRepresentative()
Gets aRepoPackage(either local or remote) corresponding to this updatable package. This will be the local package if there is one, and the remote otherwise.
-
isUpdate
public boolean isUpdate()
- Returns:
trueif this package is installed and a newer version is available.
-
getPath
public java.lang.String getPath()
- Returns:
- The
pathof the local and/or remote package.
-
-