org.geotoolkit.metadata.iso.constraint
Class DefaultConstraints

Object
  extended by AbstractMetadata
      extended by ModifiableMetadata
          extended by MetadataEntity
              extended by DefaultConstraints
All Implemented Interfaces:
Serializable, Cloneable, LenientComparable, IdentifiedObject, Constraints
Direct Known Subclasses:
DefaultLegalConstraints, DefaultSecurityConstraints

@ThreadSafe
public class DefaultConstraints
extends MetadataEntity
implements Constraints

Restrictions on the access and use of a resource or metadata.

Since:
2.1
Version:
3.20
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
 
Constructor Summary
DefaultConstraints()
          Constructs an initially empty constraints.
DefaultConstraints(CharSequence useLimitation)
          Constructs a new constraints with the given use limitation.
DefaultConstraints(Constraints source)
          Constructs a metadata entity initialized with the values from the specified metadata.
 
Method Summary
static DefaultConstraints castOrCopy(Constraints object)
          Returns a Geotk metadata implementation with the same values than the given arbitrary implementation.
 Collection<InternationalString> getUseLimitations()
          Returns the limitation affecting the fitness for use of the resource.
 void setUseLimitations(Collection<? extends InternationalString> newValues)
          Sets the limitation affecting the fitness for use of the resource.
 
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

DefaultConstraints

public DefaultConstraints()
Constructs an initially empty constraints.


DefaultConstraints

public DefaultConstraints(CharSequence useLimitation)
Constructs a new constraints with the given use limitation.

Parameters:
useLimitation - The use limitation, or null if none.
Since:
3.20

DefaultConstraints

public DefaultConstraints(Constraints 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
Method Detail

castOrCopy

public static DefaultConstraints castOrCopy(Constraints 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).

This method checks for the LegalConstraints and SecurityConstraints sub-interfaces. If one of those interfaces is found, then this method delegates to the corresponding castOrCopy static method. If the given object implements more than one of the above-cited interfaces, then the castOrCopy method to be used is unspecified.

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

getUseLimitations

public Collection<InternationalString> getUseLimitations()
Returns the limitation affecting the fitness for use of the resource. Example: "not to be used for navigation".

Specified by:
getUseLimitations in interface Constraints

setUseLimitations

public void setUseLimitations(Collection<? extends InternationalString> newValues)
Sets the limitation affecting the fitness for use of the resource. Example: "not to be used for navigation".

Parameters:
newValues - The new use limitation.


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