Class SimpleIdentifiedObject

java.lang.Object
org.apache.sis.internal.simple.SimpleIdentifiedObject
All Implemented Interfaces:
Serializable, LenientComparable, org.opengis.referencing.IdentifiedObject
Direct Known Subclasses:
Parameter, ReferenceSystemMetadata

public class SimpleIdentifiedObject extends Object implements org.opengis.referencing.IdentifiedObject, LenientComparable, Serializable
A trivial implementation of IdentifiedObject containing only a primary name.
Since:
0.5
Version:
0.5
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.opengis.referencing.ReferenceIdentifier
    The primary name by which this object is identified.
    private static final long
    For cross-version compatibility.

    Fields inherited from interface org.opengis.referencing.IdentifiedObject

    ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates an identified object without identifier.
     
    SimpleIdentifiedObject(org.opengis.referencing.IdentifiedObject object)
    Creates an identified object with the same identifier than the given one.
     
    SimpleIdentifiedObject(org.opengis.referencing.ReferenceIdentifier name)
    Creates an identified object with the given identifier.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    equals(Object object)
    Compares this object with the given one for equality.
    boolean
    equals(Object object, ComparisonMode mode)
    Compares this object with the given one for equality.
    final Collection<org.opengis.util.GenericName>
    Method required by the IdentifiedObject interface.
    final org.opengis.metadata.extent.Extent
    Method required by most IdentifiedObject sub-interfaces.
    final Set<org.opengis.referencing.ReferenceIdentifier>
    Method required by the IdentifiedObject interface.
    org.opengis.referencing.ReferenceIdentifier
    Returns the primary name by which this object is identified.
    final org.opengis.util.InternationalString
    Method required by the IdentifiedObject interface.
    final org.opengis.util.InternationalString
    Method required by most IdentifiedObject sub-interfaces.
    final int
    Returns a hash code value for this object.
    Returns a pseudo-WKT representation for debugging purpose.
    Throws an exception in all cases, since this object can't be formatted in a valid WKT.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • name

      protected org.opengis.referencing.ReferenceIdentifier name
      The primary name by which this object is identified.
  • Constructor Details

    • SimpleIdentifiedObject

      protected SimpleIdentifiedObject()
      Creates an identified object without identifier. This constructor is mainly for JAXB.
    • SimpleIdentifiedObject

      public SimpleIdentifiedObject(org.opengis.referencing.IdentifiedObject object)
      Creates an identified object with the same identifier than the given one.
      Parameters:
      object - the identified object to partially copy.
    • SimpleIdentifiedObject

      public SimpleIdentifiedObject(org.opengis.referencing.ReferenceIdentifier name)
      Creates an identified object with the given identifier.
      Parameters:
      name - the primary name by which this object is identified.
  • Method Details

    • getName

      public org.opengis.referencing.ReferenceIdentifier getName()
      Returns the primary name by which this object is identified.
      Specified by:
      getName in interface org.opengis.referencing.IdentifiedObject
      Returns:
      the identifier given at construction time.
    • getIdentifiers

      public final Set<org.opengis.referencing.ReferenceIdentifier> getIdentifiers()
      Method required by the IdentifiedObject interface. Current implementation returns an empty set.

      If a future version allows this method to returns a non-empty set, revisit equals(Object, ComparisonMode).

      Specified by:
      getIdentifiers in interface org.opengis.referencing.IdentifiedObject
      Returns:
      the identifiers, or an empty set if none.
    • getAlias

      public final Collection<org.opengis.util.GenericName> getAlias()
      Method required by the IdentifiedObject interface. Current implementation returns an empty set.

      If a future version allows this method to returns a non-empty set, revisit equals(Object, ComparisonMode).

      Specified by:
      getAlias in interface org.opengis.referencing.IdentifiedObject
      Returns:
      the aliases, or an empty set if none.
    • getDomainOfValidity

      public final org.opengis.metadata.extent.Extent getDomainOfValidity()
      Method required by most IdentifiedObject sub-interfaces. Current implementation returns null.

      If a future version allows this method to returns a non-null value, revisit equals(Object, ComparisonMode) in subclasses.

      Returns:
      the domain of validity, or null if none.
    • getScope

      public final org.opengis.util.InternationalString getScope()
      Method required by most IdentifiedObject sub-interfaces. Current implementation returns null.

      If a future version allows this method to returns a non-null value, revisit equals(Object, ComparisonMode) in subclasses.

      Returns:
      the scope, or null if none.
    • getRemarks

      public final org.opengis.util.InternationalString getRemarks()
      Method required by the IdentifiedObject interface. Current implementation returns null.

      If a future version allows this method to returns a non-null value, revisit equals(Object, ComparisonMode).

      Specified by:
      getRemarks in interface org.opengis.referencing.IdentifiedObject
      Returns:
      the remarks, or null if none.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object.
      Overrides:
      hashCode in class Object
    • equals

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

      public boolean equals(Object object, ComparisonMode mode)
      Compares this object with the given one for equality. This method compares the name only in "strict" or "by contract" modes. If name is a critical component of this object, then it shall be compared by the subclass. This behavior is consistent with AbstractIdentifiedObject.
      Specified by:
      equals in interface LenientComparable
      Parameters:
      object - the object to compare with this identified object.
      mode - the strictness level of the comparison.
      Returns:
      true if both objects are equal.
      See Also:
    • toWKT

      public String toWKT() throws UnsupportedOperationException
      Throws an exception in all cases, since this object can't be formatted in a valid WKT.
      Specified by:
      toWKT in interface org.opengis.referencing.IdentifiedObject
      Returns:
      the Well Known Text.
      Throws:
      UnsupportedOperationException - always thrown.
    • toString

      public String toString()
      Returns a pseudo-WKT representation for debugging purpose.
      Overrides:
      toString in class Object