|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gdata.util.Version
public class Version
The Version class is a helper class that describes version information about a particular type of service.
Field Summary | |
---|---|
static int |
ANY
The ANY value indicates a version component that will match any revision. |
Constructor Summary | |
---|---|
Version(java.lang.Class<? extends Service> serviceClass,
int major,
int minor,
Version... impliedVersions)
Creates a new Version instance for the specified service and defines the major and minor versions for the service. |
|
Version(java.lang.Class<? extends Service> serviceClass,
java.lang.String versionDescription,
Version... impliedVersions)
Creates a new Version instance using a version description with the format [{service}]{major}.{minor} . |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
java.util.List<Version> |
getImpliedVersions()
Returns the list of related services versions that are implied by this version. |
int |
getMajor()
Returns the major revision of the version. |
int |
getMinor()
Returns the minor revision of the version. |
java.lang.Class<? extends Service> |
getServiceClass()
Returns the service type of the version. |
java.lang.String |
getVersionString()
Returns the String representation of the version. |
int |
hashCode()
|
boolean |
isCompatible(Version v)
Returns true if the specified is compatible with this version or
one of its implied versions. |
boolean |
isSameService(Version v)
Returns true if the target version is for the same service. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ANY
Constructor Detail |
---|
public Version(java.lang.Class<? extends Service> serviceClass, int major, int minor, Version... impliedVersions) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
serviceClass
- the service type.major
- the major revision number of the service.minor
- the minor revision number of the service.
java.lang.NullPointerException
- if the service type is null
.
java.lang.IllegalArgumentException
- if revision values are invalid.public Version(java.lang.Class<? extends Service> serviceClass, java.lang.String versionDescription, Version... impliedVersions) throws java.lang.IllegalArgumentException
[{service}]{major}.{minor}
.
serviceClass
- the service type.versionDescription
- the service description.
java.lang.IllegalArgumentException
- if the versionDescription has an invalid
syntax or includes a service name that does not match the service
type.Method Detail |
---|
public final java.lang.Class<? extends Service> getServiceClass()
public final int getMajor()
public final int getMinor()
public final java.lang.String getVersionString()
public final boolean isSameService(Version v)
true
if the target version is for the same service.
v
- target version to check.
true
if service matches.public final boolean isCompatible(Version v)
true
if the specified is compatible with this version or
one of its implied versions. Two versions are compatible if they are
for the same service and have a matching major version number (or one
of them has a major version of ANY
.
public java.util.List<Version> getImpliedVersions()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |