Package io.ocfl.api.model
Enum OcflVersion
- java.lang.Object
-
- java.lang.Enum<OcflVersion>
-
- io.ocfl.api.model.OcflVersion
-
- All Implemented Interfaces:
Serializable
,Comparable<OcflVersion>
public enum OcflVersion extends Enum<OcflVersion>
Represents a version of the OCFL spec.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OcflVersion
fromOcflObjectVersionFilename(String ocflObjectVersionFilename)
Returns an OCFL version based on the name of an OCFL object Namaste filestatic OcflVersion
fromOcflObjectVersionString(String ocflObjectVersionString)
Returns an OCFL version based on the OCFL version string specified in the Namaste file in an OCFL object.static OcflVersion
fromOcflVersionFilename(String ocflVersionFilename)
Returns an OCFL version based on the name of an OCFL storage root Namaste filestatic OcflVersion
fromOcflVersionString(String ocflVersionString)
Returns an OCFL version based on the OCFL version string specified in the Namaste file in the OCFL storage root.InventoryType
getInventoryType()
String
getOcflObjectVersion()
String
getOcflVersion()
String
getRawVersion()
String
toString()
static OcflVersion
valueOf(String name)
Returns the enum constant of this type with the specified name.static OcflVersion[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
OCFL_1_0
public static final OcflVersion OCFL_1_0
-
OCFL_1_1
public static final OcflVersion OCFL_1_1
-
-
Method Detail
-
values
public static OcflVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (OcflVersion c : OcflVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static OcflVersion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getRawVersion
public String getRawVersion()
- Returns:
- the raw OCFL version number, eg 1.0
-
getOcflVersion
public String getOcflVersion()
- Returns:
- the OCFL version string as found in the Namaste file in the OCFL storage root
-
getOcflObjectVersion
public String getOcflObjectVersion()
- Returns:
- the OCFL object version string as found in the Namaste file in the OCFL object root
-
getInventoryType
public InventoryType getInventoryType()
- Returns:
- the InventoryType as specified in an object's inventory file
-
toString
public String toString()
- Overrides:
toString
in classEnum<OcflVersion>
-
fromOcflVersionString
public static OcflVersion fromOcflVersionString(String ocflVersionString)
Returns an OCFL version based on the OCFL version string specified in the Namaste file in the OCFL storage root.- Parameters:
ocflVersionString
- the version string from the Namaste file- Returns:
- OCFL version
-
fromOcflObjectVersionString
public static OcflVersion fromOcflObjectVersionString(String ocflObjectVersionString)
Returns an OCFL version based on the OCFL version string specified in the Namaste file in an OCFL object.- Parameters:
ocflObjectVersionString
- the version string from the object Namaste file- Returns:
- OCFL version
-
fromOcflVersionFilename
public static OcflVersion fromOcflVersionFilename(String ocflVersionFilename)
Returns an OCFL version based on the name of an OCFL storage root Namaste file- Parameters:
ocflVersionFilename
- Namaste file name- Returns:
- OCFL version
-
fromOcflObjectVersionFilename
public static OcflVersion fromOcflObjectVersionFilename(String ocflObjectVersionFilename)
Returns an OCFL version based on the name of an OCFL object Namaste file- Parameters:
ocflObjectVersionFilename
- Namaste file name- Returns:
- OCFL version
-
-