Class DeprecatedCode

All Implemented Interfaces:
Serializable, Deprecable, org.opengis.metadata.Identifier, org.opengis.referencing.ReferenceIdentifier

public final class DeprecatedCode extends ImmutableIdentifier implements Deprecable
An identifier which should not be used anymore. This is used mostly for deprecated EPSG codes.
Implementation note: this class opportunistically recycles the description property into a remarks property. This is a lazy way to inherit ImmutableIdentifier.equals(Object) and ImmutableIdentifier.hashCode() implementations without adding code in this class for taking in account a new field.
Since:
0.6
Version:
0.7
See Also:
  • Field Details

    • serialVersionUID

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

      public final String replacedBy
      The replacement for the deprecated object, or null if none.
  • Constructor Details

    • DeprecatedCode

      public DeprecatedCode(org.opengis.metadata.citation.Citation authority, String codeSpace, String code, String version, String replacedBy, org.opengis.util.InternationalString remarks)
      Creates a deprecated identifier.
      Parameters:
      authority - organization or party responsible for definition and maintenance of the code space or code.
      codeSpace - name or identifier of the person or organization responsible for namespace.
      code - identifier code or name, optionally from a controlled list or pattern defined by a code space.
      version - the version of the associated code space or code as specified by the code authority, or null if none.
      replacedBy - the replacement for the deprecated object, or null if none.
      remarks - comments on or information about why this identifier is deprecated, or null if none.
  • Method Details

    • isDeprecated

      public boolean isDeprecated()
      Returns true since this identifier is deprecated.
      Specified by:
      isDeprecated in interface Deprecable
      Returns:
      true.
    • getRemarks

      public org.opengis.util.InternationalString getRemarks()
      Information about the replacement for this identifier.
      Example: "superseded by code XYZ".
      Specified by:
      getRemarks in interface Deprecable
      Returns:
      information about the replacement for this identifier, or null if none.
    • getDescription

      public org.opengis.util.InternationalString getDescription()
      Returns null, since we used the description for the superseded information. See "Implementation note" in class javadoc.
      Overrides:
      getDescription in class ImmutableIdentifier
      Returns:
      null.