Class LowerSnakeCaseKeyMapper

java.lang.Object
space.arim.dazzleconf.backend.LowerSnakeCaseKeyMapper
All Implemented Interfaces:
KeyMapper

public final class LowerSnakeCaseKeyMapper extends Object implements KeyMapper
A key mapper which converts lower camel case patterns to snake case.

For example, a method named "myConfOption" will become "my_conf_option" using this key mapper. This is the naming scheme (by convention) for SQL columns, Python fields and functions, and Rust struct fields.

  • Constructor Details

    • LowerSnakeCaseKeyMapper

      public LowerSnakeCaseKeyMapper()
      Creates
  • Method Details

    • labelToKey

      public @NonNull CharSequence labelToKey(@NonNull CharSequence label)
      Description copied from interface: KeyMapper
      Turns the argument into a key.

      The argument is usually a method name, and as such, it should follow lowerCamelCase convention.

      Specified by:
      labelToKey in interface KeyMapper
      Parameters:
      label - the method name
      Returns:
      the key part