Class Version
- Object
-
- Version
-
public final class Version extends Object
Union type class for theVersion
Union type in FES 2.0.The union is actually captured as a union inside a single long field.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Version.Action
The VersionAction attribute may also be the strings FIRST, LATEST, PREVIOUS, NEXT and ALL.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Date
getDateTime()
Version requested as the closest to the provided date.Integer
getIndex()
Version requested as defined by an index (from 1 through to the latest).Version.Action
getVersionAction()
Version requested using a predefined constant.int
hashCode()
boolean
isDateTime()
boolean
isEmpty()
boolean
isIndex()
Version index requested.boolean
isVersionAction()
long
union()
Access to the union memento; this may be stored as an encoding of the Version in memory sensitive settings where the over head of an object is not desired.static Version
valueOf(long union)
-
-
-
Constructor Detail
-
Version
public Version()
Theempty
Version constructor.
-
Version
public Version(Version.Action action)
-
Version
public Version(Integer index)
- Parameters:
index
- a positive integer > 0, representing the 1 based index of the requested feature in its version history.
-
Version
public Version(Date dateTime)
-
-
Method Detail
-
valueOf
public static Version valueOf(long union)
-
isEmpty
public boolean isEmpty()
-
isVersionAction
public boolean isVersionAction()
-
union
public long union()
Access to the union memento; this may be stored as an encoding of the Version in memory sensitive settings where the over head of an object is not desired.To restore please use
new Version( union )
- Returns:
- memento holding the contents of a Version object
-
getVersionAction
public Version.Action getVersionAction()
Version requested using a predefined constant.The versionAction attribute may also be the strings FIRST, LATEST, PREVIOUS, NEXT and ALL. The token FIRST shall select the first version of a resource. The token LATEST shall select the most recent version of a resource. The PREVIOUS and NEXT tokens shall select the previous or next version of a resource relative to the version specified using the rid attribute. The token ALL shall select all available version of a resource.
- Returns:
- Version requested using a predefined constant.
-
isIndex
public boolean isIndex()
Version index requested.- Returns:
- true if the Version is supplied by an index
-
getIndex
public Integer getIndex()
Version requested as defined by an index (from 1 through to the latest).The version attribute may be an integer N indicating that the Nth version of the resource shall be selected. The first version of a resource shall be numbered 1. If N exceeds the number of versions available, the latest version of the resource shall be selected.
- Returns:
- index of version requested (from 1 through to the latest)
-
isDateTime
public boolean isDateTime()
-
getDateTime
public Date getDateTime()
Version requested as the closest to the provided date.The version attribute may also be date indicating that the version of the resource closest to the specified date shall be selected.
- Returns:
- date of version requested
-
-