Class UnmodifiableParameterValueGroup

java.lang.Object
org.apache.sis.parameter.Parameters
org.apache.sis.parameter.UnmodifiableParameterValueGroup
All Implemented Interfaces:
Serializable, Cloneable, LenientComparable, org.opengis.parameter.GeneralParameterValue, org.opengis.parameter.ParameterValueGroup
Direct Known Subclasses:
FilteredParameters

class UnmodifiableParameterValueGroup extends Parameters implements LenientComparable, Serializable
A parameter value group which cannot be modified. This is especially important for parameters of defining conversions since the same instance can be used for various source and target CRS. Since EPSGFactory caches the Conversion instances, unexpected behavior results if the parameters of a cached conversion have been modified, for example with the addition of semi_major and semi_minor parameters by DefaultMathTransformFactory.
Since:
0.7
Version:
1.3
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serial number for inter-operability with different versions.
      See Also:
    • descriptor

      private final org.opengis.parameter.ParameterDescriptorGroup descriptor
      The parameter descriptor.
      See Also:
    • values

      private final List<org.opengis.parameter.GeneralParameterValue> values
      The parameter values.
      See Also:
  • Constructor Details

    • UnmodifiableParameterValueGroup

      UnmodifiableParameterValueGroup(UnmodifiableParameterValueGroup group)
      Creates a copy of the given parameter group. This is used by FilteredParameters constructor only.
      Parameters:
      group - the group of values to copy.
    • UnmodifiableParameterValueGroup

      private UnmodifiableParameterValueGroup(org.opengis.parameter.ParameterValueGroup group, Map<org.opengis.parameter.ParameterValueGroup,Boolean> done)
      Creates a new unmodifiable parameter group.
      Parameters:
      group - the group of values to copy.
      done - an initially empty map used for protection against circular references.
      See Also:
  • Method Details

    • create

      static UnmodifiableParameterValueGroup create(org.opengis.parameter.ParameterValueGroup group)
      Creates a new unmodifiable parameter group.
      Parameters:
      group - the group of values to copy, or null.
      Returns:
      the unmodifiable parameter group, or null if the given argument was null.
    • getDescriptor

      public org.opengis.parameter.ParameterDescriptorGroup getDescriptor()
      Returns the abstract definition of this group of parameters.
      Specified by:
      getDescriptor in interface org.opengis.parameter.GeneralParameterValue
      Specified by:
      getDescriptor in interface org.opengis.parameter.ParameterValueGroup
    • values

      public List<org.opengis.parameter.GeneralParameterValue> values()
      Returns the values in this group.
      Specified by:
      values in interface org.opengis.parameter.ParameterValueGroup
    • isKnownImplementation

      final boolean isKnownImplementation()
      Specifies that this class does not override parameter(String) in a way incompatible with Parameters.parameterIfExist(String).
      Overrides:
      isKnownImplementation in class Parameters
    • parameter

      public final org.opengis.parameter.ParameterValue<?> parameter(String name) throws org.opengis.parameter.ParameterNotFoundException
      Returns the value in this group for the specified name.
      Specified by:
      parameter in interface org.opengis.parameter.ParameterValueGroup
      Throws:
      org.opengis.parameter.ParameterNotFoundException
    • groups

      public List<org.opengis.parameter.ParameterValueGroup> groups(String name) throws org.opengis.parameter.ParameterNotFoundException
      Returns all subgroups with the specified name.
      Specified by:
      groups in interface org.opengis.parameter.ParameterValueGroup
      Throws:
      org.opengis.parameter.ParameterNotFoundException
    • addGroup

      public final org.opengis.parameter.ParameterValueGroup addGroup(String name) throws IllegalStateException
      Operation not allowed.
      Specified by:
      addGroup in interface org.opengis.parameter.ParameterValueGroup
      Throws:
      IllegalStateException
    • clone

      public Parameters clone()
      Returns a modifiable copy of this parameter value group.
      Specified by:
      clone in interface org.opengis.parameter.GeneralParameterValue
      Specified by:
      clone in interface org.opengis.parameter.ParameterValueGroup
      Overrides:
      clone in class Parameters
      Returns:
      a copy of this group of parameter values.
      See Also:
    • equals

      public boolean equals(Object object, ComparisonMode mode)
      Compares the specified object with this parameter for equality. The strictness level is controlled by the second argument:
      Specified by:
      equals in interface LenientComparable
      Parameters:
      object - the object to compare to this.
      mode - the strictness level of the comparison.
      Returns:
      true if both objects are equal according the given comparison mode.
      See Also:
    • equals

      public final boolean equals(Object object)
      Compares the specified object with this parameter for equality.
      Specified by:
      equals in interface LenientComparable
      Overrides:
      equals in class Object
      Parameters:
      object - the object to compare to this.
      Returns:
      true if both objects are equal.
      See Also:
    • hashCode

      public int hashCode()
      Returns a hash value for this parameter.
      Overrides:
      hashCode in class Object