Class DeprecatedCode
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.ImmutableIdentifier
org.apache.sis.internal.referencing.DeprecatedCode
- All Implemented Interfaces:
Serializable,Deprecable,org.opengis.metadata.Identifier,org.opengis.referencing.ReferenceIdentifier
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 Summary
FieldsModifier and TypeFieldDescriptionfinal StringThe replacement for the deprecated object, ornullif none.private static final longFor cross-version compatibility.Fields inherited from class org.apache.sis.referencing.ImmutableIdentifier
DESCRIPTION_KEYFields inherited from interface org.opengis.metadata.Identifier
AUTHORITY_KEY, CODE_KEYFields inherited from interface org.opengis.referencing.ReferenceIdentifier
CODESPACE_KEY, VERSION_KEY -
Constructor Summary
ConstructorsConstructorDescriptionDeprecatedCode(org.opengis.metadata.citation.Citation authority, String codeSpace, String code, String version, String replacedBy, org.opengis.util.InternationalString remarks) Creates a deprecated identifier. -
Method Summary
Modifier and TypeMethodDescriptionorg.opengis.util.InternationalStringReturnsnull, since we used the description for the superseded information.org.opengis.util.InternationalStringInformation about the replacement for this identifier.booleanReturnstruesince this identifier is deprecated.Methods inherited from class org.apache.sis.referencing.ImmutableIdentifier
castOrCopy, equals, formatTo, getAuthority, getCode, getCodeSpace, getVersion, hashCodeMethods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
replacedBy
The replacement for the deprecated object, ornullif 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, ornullif none.replacedBy- the replacement for the deprecated object, ornullif none.remarks- comments on or information about why this identifier is deprecated, ornullif none.
-
-
Method Details
-
isDeprecated
public boolean isDeprecated()Returnstruesince this identifier is deprecated.- Specified by:
isDeprecatedin interfaceDeprecable- Returns:
true.
-
getRemarks
public org.opengis.util.InternationalString getRemarks()Information about the replacement for this identifier.Example: "superseded by code XYZ".- Specified by:
getRemarksin interfaceDeprecable- Returns:
- information about the replacement for this identifier, or
nullif none.
-
getDescription
public org.opengis.util.InternationalString getDescription()Returnsnull, since we used the description for the superseded information. See "Implementation note" in class javadoc.- Overrides:
getDescriptionin classImmutableIdentifier- Returns:
null.
-