Package org.apache.sis.feature

# Class AbstractIdentifiedType

Object
AbstractIdentifiedType

All Implemented Interfaces:
  `Serializable`, `Deprecable`

Direct Known Subclasses:
  `AbstractOperation`, `DefaultAssociationRole`, `DefaultAttributeType`, `DefaultFeatureType`

public class AbstractIdentifiedType extends Object implements Deprecable, Serializable
Identification and description information inherited by property types and feature types.
Warning: This class is expected to implement a GeoAPI `IdentifiedType` interface in a future version. When such interface will be available, most references to `AbstractIdentifiedType` in the API will be replaced by references to the `IdentifiedType` interface.

Since:
  0.5
See Also:
  - Serialized Form

Defined in the `sis-feature` module

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `DEFINITION_KEY`
  Key for the `"definition"` property to be given to the constructor.
  `static final String`
  `DEPRECATED_KEY`
  Key for the `"deprecated"` property to be given to the constructor.
  `static final String`
  `DESCRIPTION_KEY`
  Key for the `"description"` property to be given to the constructor.
  `static final String`
  `DESIGNATION_KEY`
  Key for the `"designation"` property to be given to the constructor.
  `static final String`
  `NAME_KEY`
  Key for the `"name"` property to be given to the constructor.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractIdentifiedType(Map<String,?> identification)`
  Constructs a type from the given properties.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  Compares this type with the given object for equality.
  `InternationalString`
  `getDefinition()`
  Returns a concise definition of the element.
  `InternationalString`
  `getDescription()`
  Returns optional information beyond that required for concise definition of the element.
  `InternationalString`
  `getDesignation()`
  Returns a natural language designator for the element.
  `final GenericName`
  `getName()`
  Returns the name of this type.
  `InternationalString`
  `getRemarks()`
  Returns comments on or information about this type.
  `int`
  `hashCode()`
  Returns a hash code value for this type.
  `boolean`
  `isDeprecated()`
  Returns `true` if this type is deprecated.

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### NAME_KEY

    public static final String NAME_KEY
    Key for the `"name"` property to be given to the constructor. This is used for setting the value to be returned by `getName()`.
    See Also:
      - `getName()`
      - Constant Field Values

  - ### DEFINITION_KEY

    public static final String DEFINITION_KEY
    Key for the `"definition"` property to be given to the constructor. This is used for setting the value to be returned by `getDefinition()`.
    See Also:
      - `getDefinition()`
      - Constant Field Values

  - ### DESIGNATION_KEY

    public static final String DESIGNATION_KEY
    Key for the `"designation"` property to be given to the constructor. This is used for setting the value to be returned by `getDesignation()`.
    See Also:
      - `getDesignation()`
      - Constant Field Values

  - ### DESCRIPTION_KEY

    public static final String DESCRIPTION_KEY
    Key for the `"description"` property to be given to the constructor. This is used for setting the value to be returned by `getDescription()`.
    See Also:
      - `getDescription()`
      - Constant Field Values

  - ### DEPRECATED_KEY

    public static final String DEPRECATED_KEY
    Key for the `"deprecated"` property to be given to the constructor. This is used for setting the value to be returned by `isDeprecated()`.

    If this property is set to `true`, then the value associated to `DESCRIPTION_KEY` should give the replacement (e.g. "superceded by …").

    Since:
      0.8
    See Also:
      - `isDeprecated()`
      - Constant Field Values

- ## Constructor Details

  - ### AbstractIdentifiedType

    protected AbstractIdentifiedType(Map<String,?> identification) throws IllegalArgumentException
    Constructs a type from the given properties. Keys are strings from the table below. The map given in argument shall contain an entry at least for the "name". Other entries listed in the table below are optional.

    Recognized map entries
    Map key | Value type | Returned by
    --- | --- | ---
    "name" | `GenericName` or `String` | `getName()`
    "definition" | `InternationalString` or `String` | `getDefinition()`
    "designation" | `InternationalString` or `String` | `getDesignation()`
    "description" | `InternationalString` or `String` | `getDescription()`
    "deprecated" | `Boolean` | `isDeprecated()`
    "locale" | `Locale` | (none)

    #### Localization

    All localizable attributes like `"definition"` may have a language and country code suffix. For example the `"definition_fr"` property stands for remarks in French and the `"definition_fr_CA"` property stands for remarks in French Canadian. They are convenience properties for building the `InternationalString` value.

    The `"locale"` property applies only in case of exception for formatting the error message, and is used only on a best effort basis. The locale is discarded after successful construction since localizations are applied by the `InternationalString​.toString(Locale)` method.

    Parameters:
      `identification` - the name and other information to be given to this identified type.
    Throws:
      `IllegalArgumentException` - if a property has an invalid value.

- ## Method Details

  - ### getName

    public final GenericName getName()
    Returns the name of this type. The namespace can be either explicit (scoped name) or implicit (local name).

    For feature types, the name is mandatory and shall be unique in the unit processing the data (e.g. a `DataStore` reading a file).

    Note for subclasses: this method is final because it is invoked (indirectly) by subclass constructors, and invoking a user-overrideable method at construction time is not recommended. Furthermore, this attribute is often used as the primary key for `IdentifiedType` instances and need some guarantees about its stability.
    Returns:
      the type name.

  - ### getDefinition

    public InternationalString getDefinition()
    Returns a concise definition of the element.
    Returns:
      concise definition of the element.

  - ### getDesignation

    public InternationalString getDesignation()
    Returns a natural language designator for the element. This can be used as an alternative to the name in user interfaces.
    Returns:
      natural language designator for the element, or `null` if none.

  - ### getDescription

    public InternationalString getDescription()
    Returns optional information beyond that required for concise definition of the element. The description may assist in understanding the element scope and application.

    If this type is deprecated, then the description should give indication about the replacement (e.g. "superceded by …").

    Returns:
      information beyond that required for concise definition of the element, or `null` if none.

  - ### getRemarks

    public InternationalString getRemarks()
    Returns comments on or information about this type. The default implementation performs the following choice:
    - If this type is deprecated, returns the description. The description of deprecated types should give indication about the replacement (e.g. "superceded by …").
    - Otherwise returns `null` since remarks are not part of the ISO 19109 feature model.
    Specified by:
      `getRemarks` in interface `Deprecable`
    Returns:
      the remarks, or `null` if none.
    Since:
      0.8

  - ### isDeprecated

    public boolean isDeprecated()
    Returns `true` if this type is deprecated. If this method returns `true`, then the remarks should give indication about the replacement (e.g. "superceded by …").
    Specified by:
      `isDeprecated` in interface `Deprecable`
    Returns:
      whether this type is deprecated.
    Since:
      0.8

  - ### hashCode

    public int hashCode()
    Returns a hash code value for this type.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      the hash code for this type.

  - ### equals

    public boolean equals(Object obj)
    Compares this type with the given object for equality.
    Overrides:
      `equals` in class `Object`
    Parameters:
      `obj` - the object to compare with this type.
    Returns:
      `true` if the given object is equals to this type.