Package io.ocfl.core.model
Class Version
- java.lang.Object
-
- io.ocfl.core.model.Version
-
public class Version extends Object
OCFL version object. A Version describes the state of an object at a particular point in time. Versions are immutable.- See Also:
VersionBuilder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VersionBuilder
builder()
static VersionBuilder
builder(Version original)
boolean
equals(Object o)
OffsetDateTime
getCreated()
String
getFileId(String path)
Returns the file id associated to the given logical path.String
getMessage()
Set<String>
getPaths(String fileId)
Returns the logical paths associated with the given file idMap<String,Set<String>>
getState()
A map of all of the files that are part of this version of the object.User
getUser()
int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
Version
public Version(OffsetDateTime created, String message, User user, Map<String,Set<String>> state)
- Parameters:
created
- timestamp the version was createdmessage
- version messageuser
- user who created the versionstate
- version state- See Also:
VersionBuilder
-
-
Method Detail
-
builder
public static VersionBuilder builder()
-
builder
public static VersionBuilder builder(Version original)
-
getCreated
public OffsetDateTime getCreated()
- Returns:
- the timestamp when this version of the object was created.
-
getMessage
public String getMessage()
- Returns:
- a human readable message describing the version.
-
getUser
public User getUser()
- Returns:
- the person who created this version of the object.
-
getState
public Map<String,Set<String>> getState()
A map of all of the files that are part of this version of the object. The map is keyed on file digest ids, and the values are paths that describe where the file is located in this specific version.- Returns:
- version state
-
getFileId
public String getFileId(String path)
Returns the file id associated to the given logical path.- Parameters:
path
- logical path- Returns:
- associated file id
-
getPaths
public Set<String> getPaths(String fileId)
Returns the logical paths associated with the given file id- Parameters:
fileId
- file id- Returns:
- associated logical paths
-
-