@Immutable public class ImmutableIdentifier extends Object implements ReferenceIdentifier, Deprecable, Serializable
CoordinateReferenceSystem
objects.
Note: WhileImmutableIdentifier
objects are immutable, they may contain references toCitation
andInternationalString
objects which are not guaranteed to be immutable. For better safety, factory codes are encouraged to pass only immutable citations and immutable international strings to the constructors.
DefaultIdentifier
,
Serialized FormDefined in the sis-metadata module
CODESPACE_KEY, VERSION_KEY
AUTHORITY_KEY, CODE_KEY
Constructor and Description |
---|
ImmutableIdentifier(Citation authority,
String codeSpace,
String code)
Creates a new identifier from the specified code and authority.
|
ImmutableIdentifier(Citation authority,
String codeSpace,
String code,
String version,
InternationalString remarks)
Creates a new identifier from the specified code and authority,
with an optional version number and remarks.
|
ImmutableIdentifier(Map<String,?> properties)
Constructs an identifier from a set of properties.
|
ImmutableIdentifier(ReferenceIdentifier identifier)
Creates a new identifier from the specified one.
|
Modifier and Type | Method and Description |
---|---|
static ImmutableIdentifier |
castOrCopy(ReferenceIdentifier object)
Returns a SIS identifier implementation with the values of the given arbitrary implementation.
|
boolean |
equals(Object object)
Compares this object with the given one for equality.
|
Citation |
getAuthority()
Organization or party responsible for definition and maintenance of the
code.
|
String |
getCode()
Identifier code or name, optionally from a controlled list or pattern.
|
String |
getCodeSpace()
Name or identifier of the person or organization responsible for namespace.
|
InternationalString |
getRemarks()
Comments on or information about this identifier, or
null if none. |
String |
getVersion()
Identifier of the version of the associated code space or code, as specified by the
code authority.
|
int |
hashCode()
Returns a hash code value for this object.
|
boolean |
isDeprecated()
Returns
true if the object represented by this identifier is deprecated. |
String |
toString()
Returns a string representation of this identifier.
|
public ImmutableIdentifier(ReferenceIdentifier identifier)
identifier
- The identifier to copy.public ImmutableIdentifier(Citation authority, String codeSpace, String code)
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.
This is often an abbreviation of the authority name.code
- Identifier code or name, optionally from a controlled list or pattern defined by
a code space. The code can not be null.public ImmutableIdentifier(Citation authority, String codeSpace, String code, String version, InternationalString remarks)
authority
- Organization or party responsible for definition and maintenance of the code
space or code, or null
if not available.codeSpace
- Name or identifier of the person or organization responsible for namespace, or
null
if not available. This is often an abbreviation of the authority name.code
- Identifier code or name, optionally from a controlled list or pattern defined by
a code space. The code can not be null.version
- The version of the associated code space or code as specified by the code authority,
or null
if none.remarks
- Comments on or information about this identifier, or null
if none.public ImmutableIdentifier(Map<String,?> properties) throws IllegalArgumentException
"code"
property. Other properties listed in
the table below are optional.
Property name | Value type | Value given to |
---|---|---|
"code" | String |
getCode() |
"codespace" | String |
getCodeSpace() |
"authority" | String or Citation |
getAuthority() |
"version" | String |
getVersion() |
"remarks" | String or InternationalString |
getRemarks() |
"remarks"
is a localizable attributes which may have a language and country
code suffix. For example the "remarks_fr"
property stands for remarks in
French and the "remarks_fr_CA"
property stands
for remarks in French Canadian.properties
- The properties to be given to this identifier.InvalidParameterValueException
- if a property has an invalid value.IllegalArgumentException
- if a property is invalid for some other reason.public static ImmutableIdentifier castOrCopy(ReferenceIdentifier object)
null
, then this method returns null
.ImmutableIdentifier
, then it is returned unchanged.ImmutableIdentifier
instance is created using the
copy constructor
and returned. Note that this is a shallow copy operation, since the other
metadata contained in the given object are not recursively copied.object
- The object to get as a SIS implementation, or null
if none.null
if the argument was null.public String getCode()
getCode
in interface Identifier
null
.NamedIdentifier#tip()
public String getCodeSpace()
getCodeSpace
in interface ReferenceIdentifier
null
if not available.NamedIdentifier#head()
,
NamedIdentifier#scope()
public Citation getAuthority()
getAuthority
in interface Identifier
null
if not available.org.apache.sis.metadata.iso.citation.Citations#EPSG
public String getVersion()
getVersion
in interface ReferenceIdentifier
null
if not available.public InternationalString getRemarks()
null
if none.getRemarks
in interface Deprecable
null
if none.public boolean isDeprecated()
true
if the object represented by this identifier is deprecated. In such
case, the remarks may contains the new identifier to use.
The default implementation returns false
in all cases.
isDeprecated
in interface Deprecable
true
if this code is deprecated.AbstractIdentifiedObject#isDeprecated()
public int hashCode()
public boolean equals(Object object)
public String toString()
Note: TheNamedIdentifier
subclass overrides this method with a different behavior, in order to be compliant with the contract of theGenericName
interface.
Copyright © 2010–2013 The Apache Software Foundation. All rights reserved.