Enum AttributeRole

java.lang.Object
java.lang.Enum<AttributeRole>
org.apache.sis.feature.builder.AttributeRole
All Implemented Interfaces:
Serializable, Comparable<AttributeRole>, java.lang.constant.Constable

public enum AttributeRole extends Enum<AttributeRole>
Roles that can be associated to some attributes for instructing FeatureTypeBuilder how to generate predefined operations. Those predefined operations are:
  • A compound operation for generating a unique identifier from an arbitrary number of attribute values.
  • A link operation for referencing a geometry to be used as the default geometry.
  • An operation for computing the bounding box of all geometries found in the feature. This operation is automatically added if the feature contains a default geometry.
This enumeration allows user code to specify which feature attribute to use for creating those operations.
Since:
0.8
Version:
0.8
See Also:
  • Enum Constant Details

    • IDENTIFIER_COMPONENT

      public static final AttributeRole IDENTIFIER_COMPONENT
      Attribute value will be part of a unique identifier for the feature instance. An arbitrary number of attributes can be flagged as identifier components:
      • If no attribute has this role, then no attribute is marked as feature identifier.
      • If exactly one attribute has this role, then a synthetic attribute named "sis:identifier" will be created as a link to the flagged attribute.
      • If more than one attribute have this role, then a synthetic attribute named "sis:identifier" will be created as a compound key made of all flagged attributes. The separator character can be modified by a call to FeatureTypeBuilder.setIdentifierDelimiters(String, String, String)
      See Also:
    • DEFAULT_GEOMETRY

      public static final AttributeRole DEFAULT_GEOMETRY
      Attribute value will be flagged as the default geometry. Feature can have an arbitrary number of geometry attributes, but only one can be flagged as the default geometry.
  • Constructor Details

    • AttributeRole

      private AttributeRole()
  • Method Details

    • values

      public static AttributeRole[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static AttributeRole valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • merge

      static Set<AttributeRole> merge(Set<AttributeRole> oldValue, Set<AttributeRole> newValue)
      Returns the union of the given set of attribute roles.