Class ObjectToString.CodeList<S extends org.opengis.util.CodeList<S>>

All Implemented Interfaces:
Serializable, Function<S,String>, ObjectConverter<S,String>
Enclosing class:
ObjectToString<S>

static final class ObjectToString.CodeList<S extends org.opengis.util.CodeList<S>> extends ObjectToString<S>
Specialized instance for CodeList. This class invokes CodeList.name() instead of toString().
See Also:
  • Field Details

  • Constructor Details

    • CodeList

      CodeList(Class<S> sourceClass, SystemConverter<String,S> inverse)
      Creates a new converter from the given type of code list to strings.
  • Method Details

    • properties

      public Set<FunctionProperty> properties()
      Function is bijective, because no duplicated code list name shall exist.
      Specified by:
      properties in interface ObjectConverter<S extends org.opengis.util.CodeList<S>,String>
      Overrides:
      properties in class ObjectToString<S extends org.opengis.util.CodeList<S>>
      Returns:
      the manners in which source values are mapped to target values. May be an empty set, but never null.
    • apply

      public String apply(S source)
      Returns the name of the given code list element.
      Specified by:
      apply in interface Function<S extends org.opengis.util.CodeList<S>,String>
      Specified by:
      apply in interface ObjectConverter<S extends org.opengis.util.CodeList<S>,String>
      Overrides:
      apply in class ObjectToString<S extends org.opengis.util.CodeList<S>>
      Parameters:
      source - the object to convert, or null.
      Returns:
      the converted object, or null.