Class EnumPreferenceSerializer<T extends java.lang.Enum<T>>

  • All Implemented Interfaces:
    PreferenceSerializer<T,​java.lang.String>

    public final class EnumPreferenceSerializer<T extends java.lang.Enum<T>>
    extends java.lang.Object
    implements PreferenceSerializer<T,​java.lang.String>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T deserialize​(java.lang.String value)
      Convert from persistent type to runtime type.
      java.lang.String serialize​(T value)
      Convert from runtime type to persistent type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EnumPreferenceSerializer

        public EnumPreferenceSerializer​(java.lang.Class<T> clazz)
    • Method Detail

      • serialize

        public java.lang.String serialize​(T value)
        Description copied from interface: PreferenceSerializer
        Convert from runtime type to persistent type. If the persistent type is a primitive (wrapper) the return value must not be null.
        Specified by:
        serialize in interface PreferenceSerializer<T extends java.lang.Enum<T>,​java.lang.String>
        Parameters:
        value - an object of the runtime type
        Returns:
        the persistent type representation of the parameter
      • deserialize

        public T deserialize​(java.lang.String value)
        Description copied from interface: PreferenceSerializer
        Convert from persistent type to runtime type. If the persistent type is a primitive (wrapper) the parameter is guaranteed to not be null
        Specified by:
        deserialize in interface PreferenceSerializer<T extends java.lang.Enum<T>,​java.lang.String>
        Parameters:
        value - an object of the persistent type
        Returns:
        the runtime type value of the parameter