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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UpdatablePackage
public UpdatablePackage(@NonNull
LocalPackage localInfo)
UpdatablePackage
public UpdatablePackage(@NonNull
RemotePackage remoteInfo)
UpdatablePackage
public UpdatablePackage(@NonNull
LocalPackage localInfo,
@NonNull
RemotePackage remoteInfo)
addRemote
public void addRemote(@NonNull
RemotePackage remote)
- Adds the given remote package if this package doesn't already have a remote, or if the given
remote is more recent. If it is a preview, it will be returned by
getRemote(boolean)
only if it is specified that preview packages are desired.
- Parameters:
remote - The remote package.
getLocalInfo
@Nullable
public LocalPackage getLocalInfo()
getRemote
@Nullable
public RemotePackage getRemote(boolean includePreview)
hasPreview
public boolean hasPreview()
hasRemote
public boolean hasRemote(boolean includePreview)
hasLocal
public boolean hasLocal()
compareTo
public int compareTo(@NonNull
UpdatablePackage o)
- Specified by:
compareTo in interface java.lang.Comparable<UpdatablePackage>
getRepresentative
@NonNull
public RepoPackage getRepresentative()
- Gets a
RepoPackage (either local or remote) corresponding to this updatable package.
This will be the first of:
- The
LocalPackage if the package is installed
- The preview
RemotePackage if there is a remote preview
- The remote package otherwise.
isUpdate
public boolean isUpdate(boolean includePreview)
getAllRemotes
@NonNull
public java.util.Set<RemotePackage> getAllRemotes()