Class PrimitiveConverter

java.lang.Object
redempt.redlib.config.conversion.PrimitiveConverter

public class PrimitiveConverter extends Object
A converter which can convert to and from strings, but saves values directly instead of as strings
  • Constructor Details

    • PrimitiveConverter

      public PrimitiveConverter()
  • Method Details

    • create

      public static <T> StringConverter<T> create(Function<String,T> loader, Function<T,String> saver)
      Creates a StringConverter which saves values directly rather than as strings
      Type Parameters:
      T - The type to convert
      Parameters:
      loader - The function to convert from strings
      saver - The function to convert to strings
      Returns:
      The converter