com.android.repository.api
Class UpdatablePackage

java.lang.Object
  extended by 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
UpdatablePackage(LocalPackage localPackage)
           
UpdatablePackage(LocalPackage localPackage, RemotePackage remotePackage)
           
UpdatablePackage(RemotePackage remotePackage)
           
 
Method Summary
 int compareTo(UpdatablePackage o)
           
 LocalPackage getLocal()
           
 RemotePackage getRemote()
           
 RepoPackage getRepresentative()
          Gets a RepoPackage (either local or remote) corresponding to this updatable package.
 boolean hasLocal()
           
 boolean hasRemote()
           
 boolean isUpdate()
           
 void setRemote(RemotePackage remote)
          Sets the remote package for this UpdatablePackage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 this UpdatablePackage.


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:
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 local package if there is one, and the remote otherwise.


isUpdate

public boolean isUpdate()