Enum Class MapKeyNamingType

java.lang.Object
java.lang.Enum<MapKeyNamingType>
org.seasar.doma.MapKeyNamingType
All Implemented Interfaces:
Serializable, Comparable<MapKeyNamingType>, Constable

public enum MapKeyNamingType extends Enum<MapKeyNamingType>
Defines naming convention rules for the keys contained in a Map<Object, String> object.

The key name is resolved from a column name by applying this convention. This is used when mapping database query results to Map objects.

Different naming conventions can be applied to transform column names into map keys according to the desired format (camel case, upper case, lower case, or unchanged).

  • Enum Constant Details

    • NONE

      public static final MapKeyNamingType NONE
      Does nothing.
    • CAMEL_CASE

      public static final MapKeyNamingType CAMEL_CASE
      Converts an underscore separated string to a camel case string.

      For example, AAA_BBB is converted to aaaBbb.

    • UPPER_CASE

      public static final MapKeyNamingType UPPER_CASE
      Converts a string to an upper case string.

      For example、aaaBbb is converted to AAABBB.

    • LOWER_CASE

      public static final MapKeyNamingType LOWER_CASE
      Converts a string to an lower case string.

      For example, aaaBbb is converted to aaabbb.

  • Method Details

    • values

      public static MapKeyNamingType[] 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 MapKeyNamingType 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
    • apply

      public abstract String apply(String text)
      Applies this naming conversion.
      Parameters:
      text - the text
      Returns:
      the converted text