org.geotoolkit.metadata.iso
Class DefaultIdentifier

Object
  extended by AbstractMetadata
      extended by ModifiableMetadata
          extended by MetadataEntity
              extended by DefaultIdentifier
All Implemented Interfaces:
Serializable, Cloneable, LenientComparable, IdentifiedObject, Identifier

@ThreadSafe
public class DefaultIdentifier
extends MetadataEntity
implements Identifier

Value uniquely identifying an object within a namespace.

Since:
2.1
Version:
3.19
Author:
Martin Desruisseaux (IRD, Geomatys), Touraïvane (IRD), Cédric Briançon (Geomatys)
See Also:
Serialized Form
Module:
metadata/geotk-metadata (download)    View source code for this class

Field Summary
 
Fields inherited from class MetadataEntity
identifiers
 
Fields inherited from class AbstractMetadata
LOGGER
 
Fields inherited from interface Identifier
AUTHORITY_KEY, CODE_KEY
 
Constructor Summary
DefaultIdentifier()
          Construct an initially empty identifier.
DefaultIdentifier(Citation authority, String code)
          Creates an identifier initialized to the given authority and code.
DefaultIdentifier(Identifier source)
          Constructs a metadata entity initialized with the values from the specified metadata.
DefaultIdentifier(String code)
          Creates an identifier initialized to the given code.
 
Method Summary
static DefaultIdentifier castOrCopy(Identifier object)
          Returns a Geotk metadata implementation with the same values than the given arbitrary implementation.
 Citation getAuthority()
          Organization or party responsible for definition and maintenance of the code.
 String getCode()
          Alphanumeric value identifying an instance in the namespace.
 String getVersion()
          Identifier of the version of the associated code, as specified by the code space or code authority.
 void setAuthority(Citation newValue)
          Sets the organization or party responsible for definition and maintenance of the code.
 void setCode(String newValue)
          Sets the alphanumeric value identifying an instance in the namespace.
 void setVersion(String newValue)
          Sets an identifier of the version of the associated code.
 
Methods inherited from class MetadataEntity
getIdentifier, getIdentifierMap, getIdentifiers, getStandard
 
Methods inherited from class ModifiableMetadata
checkWritePermission, clone, collectionType, copyCollection, copyList, copySet, freeze, isModifiable, nonNullCollection, nonNullList, nonNullSet, prune, unmodifiable
 
Methods inherited from class AbstractMetadata
asMap, asTree, asTreeTable, equals, equals, getInterface, hashCode, isEmpty, parse, toString
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultIdentifier

public DefaultIdentifier()
Construct an initially empty identifier.


DefaultIdentifier

public DefaultIdentifier(Identifier source)
Constructs a metadata entity initialized with the values from the specified metadata.

Parameters:
source - The metadata to copy, or null if none.
Since:
2.4

DefaultIdentifier

public DefaultIdentifier(String code)
Creates an identifier initialized to the given code.

Parameters:
code - The alphanumeric value identifying an instance in the namespace, or null if none.

DefaultIdentifier

public DefaultIdentifier(Citation authority,
                         String code)
Creates an identifier initialized to the given authority and code.

Parameters:
authority - The organization or party responsible for definition and maintenance of the code, or null if none.
code - The alphanumeric value identifying an instance in the namespace, or null if none.
Since:
2.2
Method Detail

castOrCopy

public static DefaultIdentifier castOrCopy(Identifier object)
Returns a Geotk metadata implementation with the same values than the given arbitrary implementation. If the given object is null, then this method returns null. Otherwise if the given object is already a Geotk implementation, then the given object is returned unchanged. Otherwise a new Geotk implementation is created and initialized to the attribute values of the given object, using a shallow copy operation (i.e. attributes are not cloned).

Parameters:
object - The object to get as a Geotk implementation, or null if none.
Returns:
A Geotk implementation containing the values of the given object (may be the given object itself), or null if the argument was null.
Since:
3.18

getCode

public String getCode()
Alphanumeric value identifying an instance in the namespace.

Specified by:
getCode in interface Identifier
Returns:
The code.

setCode

public void setCode(String newValue)
Sets the alphanumeric value identifying an instance in the namespace.

Parameters:
newValue - The new code

getVersion

public String getVersion()
Identifier of the version of the associated code, as specified by the code space or code authority. This version is included only when the code uses versions. When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.

Returns:
The version, or null if not available.

setVersion

public void setVersion(String newValue)
Sets an identifier of the version of the associated code.

Parameters:
newValue - The new version.

getAuthority

public Citation getAuthority()
Organization or party responsible for definition and maintenance of the code.

Specified by:
getAuthority in interface Identifier
Returns:
The authority, or null if not available.

setAuthority

public void setAuthority(Citation newValue)
Sets the organization or party responsible for definition and maintenance of the code.

Parameters:
newValue - The new authority.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.