Enum Class OcflVersion

java.lang.Object
java.lang.Enum<OcflVersion>
io.ocfl.api.model.OcflVersion
All Implemented Interfaces:
Serializable, Comparable<OcflVersion>, java.lang.constant.Constable

public enum OcflVersion extends Enum<OcflVersion>
Represents a version of the OCFL spec.
  • Enum Constant Details

  • Method Details

    • values

      public static OcflVersion[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static OcflVersion valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - 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 class Enum<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