Class CaseInsensitiveEnumConverter<T extends Enum<T>>

java.lang.Object
org.tailormap.api.configuration.CaseInsensitiveEnumConverter<T>
Type Parameters:
T - the enum type
All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<String,T>

public class CaseInsensitiveEnumConverter<T extends Enum<T>> extends Object implements org.springframework.core.convert.converter.Converter<String,T>
A utility class to convert a string to an enum in a case-insensitive way.
  • Constructor Details

    • CaseInsensitiveEnumConverter

      public CaseInsensitiveEnumConverter(Class<T> enumClass)
  • Method Details

    • convert

      public T convert(String from)
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<String,T extends Enum<T>>