Class QualityParameter

java.lang.Object
org.apache.sis.internal.simple.SimpleIdentifiedObject
org.apache.sis.internal.jaxb.metadata.replace.QualityParameter
All Implemented Interfaces:
Serializable, LenientComparable, org.opengis.parameter.GeneralParameterDescriptor, org.opengis.parameter.ParameterDescriptor, org.opengis.referencing.IdentifiedObject

public final class QualityParameter extends SimpleIdentifiedObject
Parameter information conform to the ISO 19157:2013 specification. GeoAPI tries to provides a single API for the parameter classes defined in various specifications (ISO 19111, ISO 19115, ISO 19157, Web Processing Service). But we still need separated representations at XML (un)marshalling time. This class is for the ISO 19157:2013 case.

Note that this implementation is simple and serves no other purpose than being a container for XML parsing and formatting. For real parameter framework, consider using org.apache.sis.parameter package instead.

Note about raw-type usage

We use raw type (i.e. we implement ParameterDescriptor instead of ParameterDescriptor<T>) because there is no way we can know <T> for sure at unmarshalling time. This is not a recommended practice, so this class shall not be in public API. However, it should be okay to create QualityParameter instances in Apache SIS internal code if all methods creating such instances declare ParameterDescriptor<?> as their return type.
Since:
1.3
Version:
1.3
Author:
Martin Desruisseaux (Geomatys)
See Also:
  • Method Details

    • castOrCopy

      public static QualityParameter castOrCopy(org.opengis.parameter.ParameterDescriptor<?> parameter)
      Returns the given parameter as an instance of QualityParameter.
      Parameters:
      parameter - the parameter (may be null).
      Returns:
      the service parameter, or null if the given argument was null.
    • getMinimumOccurs

      public int getMinimumOccurs()
    • getMaximumOccurs

      public int getMaximumOccurs()
    • getName

      public org.opengis.referencing.ReferenceIdentifier getName()
      Returns the name as an Identifier, which is the type requested by ISO 19111. Note that this is different than the type requested by ISO 19157, which is String.
      Specified by:
      getName in interface org.opengis.referencing.IdentifiedObject
      Overrides:
      getName in class SimpleIdentifiedObject
      Returns:
      the parameter name as an identifier (the type specified by ISO 19111).
    • getValueClass

      public Class<?> getValueClass()
      Infers the value class from the type name. This method is the reason why we cannot parameterize this QualityParameter class (see Note about raw-type usage in class javadoc), because there is no way we can ensure that the class inferred from valueType is really for type <T>.
      Specified by:
      getValueClass in interface org.opengis.parameter.ParameterDescriptor
      Returns:
      the value class inferred from the attribute type, or null if unknown.
    • getValueType

      public org.opengis.util.TypeName getValueType()
      Returns the name that describes the type of parameter values.
      Returns:
      the type name of value component(s) in this parameter.
    • getValueType

      public static org.opengis.util.TypeName getValueType(Class<?> valueClass)
      Suggests a type name for the components of given collection or array class. The component type is fetched on a best effort basis only. This method does the following checks:
      • If the given class is a class, then its component type is used.
      • Otherwise if the class is an Iterable, then the upper bound of elements is fetched.
      • Otherwise if the class is a Map, then the upper bound of keys is fetched.
      • Otherwise if the class is a Matrix or
        invalid reference
        Coverage
        , then Double components is assumed.
      • Otherwise the given class is used as if it was already a component type (i.e. a singleton item).
      Parameters:
      valueClass - the type of values for which to infer a TypeName instance.
      Returns:
      a type name for components of the given type.
    • createValue

      public final org.opengis.parameter.ParameterValue createValue()
      Creates a new instance of ParameterValue. This method delegates the work to DefaultParameterDescriptor since this ServiceParameter class is not a full-featured parameter descriptor implementation.
      Specified by:
      createValue in interface org.opengis.parameter.GeneralParameterDescriptor
      Specified by:
      createValue in interface org.opengis.parameter.ParameterDescriptor<T>
      Returns:
      a new instance of ParameterValue.
    • getValidValues

      public Set getValidValues()
      Optional properties.
      Specified by:
      getValidValues in interface org.opengis.parameter.ParameterDescriptor<T>
      Returns:
      null.
    • getMinimumValue

      public Comparable getMinimumValue()
      Specified by:
      getMinimumValue in interface org.opengis.parameter.ParameterDescriptor<T>
    • getMaximumValue

      public Comparable getMaximumValue()
      Specified by:
      getMaximumValue in interface org.opengis.parameter.ParameterDescriptor<T>
    • getDefaultValue

      public Object getDefaultValue()
      Specified by:
      getDefaultValue in interface org.opengis.parameter.ParameterDescriptor<T>
    • getUnit

      public javax.measure.Unit getUnit()
      Specified by:
      getUnit in interface org.opengis.parameter.ParameterDescriptor<T>
    • equals

      public final boolean equals(Object object, ComparisonMode mode)
      Compares this object with the given one for equality. This implementation should be consistent with AbstractIdentifiedObject.equals(Object) implementation, with the simplification that some Parameter property values are always null.
      Specified by:
      equals in interface LenientComparable
      Overrides:
      equals in class SimpleIdentifiedObject
      Parameters:
      object - the object to compare with this reference system.
      mode - the strictness level of the comparison.
      Returns:
      true if both objects are equal.
      See Also: