Enum Class JhoveMessages

java.lang.Object
java.lang.Enum<JhoveMessages>
edu.harvard.hul.ois.jhove.messages.JhoveMessages
All Implemented Interfaces:
Serializable, Comparable<JhoveMessages>, java.lang.constant.Constable

public enum JhoveMessages extends Enum<JhoveMessages>
Utility class that handles creation of Message type instances, etc.
Author:
Carl Wilson carlwilson AT github
  • Enum Constant Details

  • Field Details

  • Method Details

    • values

      public static JhoveMessages[] 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 JhoveMessages 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
    • getMessageInstance

      public static JhoveMessage getMessageInstance(String message) throws IllegalArgumentException
      Create a new message instance with a DEFAULT_ID
      Parameters:
      message - the message of the new message
      Returns:
      the new message instance
      Throws:
      IllegalArgumentException - if the id or message is null or empty
    • getMessageInstance

      public static JhoveMessage getMessageInstance(String id, String message) throws IllegalArgumentException
      Create a JhoveMessage instance with the give id and message value
      Parameters:
      id - the id of the new message
      message - the message of the new message
      Returns:
      the new message instance
      Throws:
      IllegalArgumentException - if the id or message is null or empty
    • getMessageInstance

      public static JhoveMessage getMessageInstance(String id, String message, String subMessage) throws IllegalArgumentException
      Create a new JhoveMessage instance with the given id, message and sub-message
      Parameters:
      id - the id of the new message
      message - the message of the new message
      subMessage - the sub-message of the new message
      Returns:
      the new message instance
      Throws:
      IllegalArgumentException - if the id or message is null or empty
    • getInstance

      public static JhoveMessageFactory getInstance(String bundleName) throws IllegalArgumentException
      Get a JhoveMessageFactory instance with the requested property based bundle name and the default user locale
      Parameters:
      bundleName - the fully qualified resource path for the message bundle property file
      Returns:
      a new JhoveMessageFactory instance backed by the bundle property file.
      Throws:
      IllegalArgumentException - if the bundle name is empty or the message bundle can't be located
    • getInstance

      public static JhoveMessageFactory getInstance(String bundleName, Locale locale) throws IllegalArgumentException
      Get a JhoveMessageFactory instance with the requested property based bundle name and a specific locale
      Parameters:
      bundleName - the fully qualified resource path for the message bundle property file
      locale - the locale for the message bundle
      Returns:
      a new JhoveMessageFactory instance backed by the bundle property file.
      Throws:
      IllegalArgumentException - if the bundle name is empty or the message bundle can't be located