code: public static <T extends Enum<T>> Translator<T> getEnumTranslator(final Class<T> enumType)
      {
          return new Translator<T>()
          {
              @Override
              public String getPropertyName(T propertyKey)
              {
                  return propertyKey.name().toLowerCase().replace('_', '.');
              }
  
              @Override
              public T getPropertyKey(String propertyName)
              {
                  String enumName = propertyName.toUpperCase().replace('.', '_');
                  return Enum.valueOf(enumType, enumName);
              }
          };
      }
docs: Get a simple translator to convert back and forth between Enums and
  property names (keys).
  
  @param <T>
  the type of Enum representing the properties
  @param enumType
  the Enum class used to represent the properties
  @return the Enum translator implementation