Class CollectionConverter.Set

All Implemented Interfaces:
Serializable, Function<Collection<?>,Set<?>>, ObjectConverter<Collection<?>,Set<?>>
Enclosing class:
CollectionConverter<T>

public static final class CollectionConverter.Set extends CollectionConverter<Set<?>>
Converter from Collection to Set.
See Also:
  • Field Details

  • Constructor Details

    • Set

      public Set()
  • Method Details

    • apply

      public Set<?> apply(Collection<?> source)
      Description copied from interface: ObjectConverter
      Converts the given object from the source type S to the target type T. If the given object cannot be converted, then this method may either returns null or throws an exception, at implementation choice (except for injective functions, which must throw an exception - see the class Javadoc for more discussion about function properties).
      Example: in Apache SIS implementation, converters from String to Number distinguish two kinds of unconvertible objects:
      • Null or empty source string result in a null value to be returned.
      • All other kind of unparsable strings results in an exception to be thrown.
      In other words, the "" value is unconvertible but nevertheless considered as part of the converter domain, and is mapped to "no number". All other unparsable strings are considered outside the converter domain.
      Parameters:
      source - the object to convert, or null.
      Returns:
      the converted object, or null.