Class DefaultMetadata.ToLocale

java.lang.Object
org.apache.sis.internal.converter.SurjectiveConverter<PT_Locale,Locale>
org.apache.sis.metadata.iso.DefaultMetadata.ToLocale
All Implemented Interfaces:
Function<PT_Locale,Locale>, ObjectConverter<PT_Locale,Locale>
Enclosing class:
DefaultMetadata

private static final class DefaultMetadata.ToLocale extends SurjectiveConverter<PT_Locale,Locale>
Converter from PT_Locale and Locale.
  • Field Details

  • Constructor Details

    • ToLocale

      private ToLocale()
  • Method Details

    • getSourceClass

      public Class<PT_Locale> getSourceClass()
      Description copied from interface: ObjectConverter
      Returns the type of objects to convert.
      Returns:
      the type of objects to convert.
    • getTargetClass

      public Class<Locale> getTargetClass()
      Description copied from interface: ObjectConverter
      Returns the type of converted objects.
      Returns:
      the type of converted objects.
    • apply

      public Locale apply(PT_Locale p)
      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:
      p - the object to convert, or null.
      Returns:
      the converted object, or null.
    • inverse

      public ObjectConverter<Locale,PT_Locale> inverse()
      Description copied from class: SurjectiveConverter
      Unsupported operation, since surjective converters are non-invertible (unless the converter is bijective, which is decided by subclasses).
      Specified by:
      inverse in interface ObjectConverter<PT_Locale,Locale>
      Overrides:
      inverse in class SurjectiveConverter<PT_Locale,Locale>
      Returns:
      a converter for converting instances of T back to instances of S.
      See Also: