Package io.ocfl.api.model
Class ObjectVersionId
java.lang.Object
io.ocfl.api.model.ObjectVersionId
Points to a specific version of an object, encapsulating an object identifier and version number. When HEAD
is specified, then it points to whatever the most recent version of the object is.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
The object idThe version numberint
hashCode()
static ObjectVersionId
Creates an ObjectId instance that points to the HEAD version of the objectboolean
isHead()
Returns a new ObjectVersionId instance with an incremented version number.Returns a new ObjectVersionId instance with an decremented version number.toString()
static ObjectVersionId
Creates an ObjectId instance that points to a specific version of an objectstatic ObjectVersionId
version
(String objectId, VersionNum versionNum) Creates an ObjectId instance that points to a specific version of an objectstatic ObjectVersionId
Creates an ObjectId instance that points to a specific version of an object
-
Method Details
-
head
Creates an ObjectId instance that points to the HEAD version of the object- Parameters:
objectId
- the id of the object- Returns:
- new ObjectVersionId
-
version
Creates an ObjectId instance that points to a specific version of an object- Parameters:
objectId
- the id of the objectversionNum
- the OCFL version num of the version- Returns:
- new ObjectVersionId
-
version
Creates an ObjectId instance that points to a specific version of an object- Parameters:
objectId
- the id of the objectversionNum
- the OCFL version num of the version- Returns:
- new ObjectVersionId
-
version
Creates an ObjectId instance that points to a specific version of an object- Parameters:
objectId
- the id of the objectversionNum
- the OCFL version number of the version- Returns:
- new ObjectVersionId
-
getObjectId
The object id- Returns:
- the object id
-
getVersionNum
The version number- Returns:
- the version number or null if no version is specified
-
isHead
public boolean isHead()- Returns:
- true if no version number is set
-
nextVersion
Returns a new ObjectVersionId instance with an incremented version number. This may only be called if this instance has its version number set- Returns:
- new ObjectVersionId with incremented version
- Throws:
InvalidVersionException
- if the version number is not set or the version cannot be incremented
-
previousVersion
Returns a new ObjectVersionId instance with an decremented version number. This may only be called if this instance has its version number set- Returns:
- new ObjectVersionId with decremented version
- Throws:
InvalidVersionException
- if the version number is not set or the version cannot be decremented
-
toString
-
equals
-
hashCode
public int hashCode()
-