Class AttributeDef

java.lang.Object
com.atlan.model.core.AtlanObject
com.atlan.model.typedefs.AttributeDef
All Implemented Interfaces:
Serializable, Comparable<AttributeDef>
Direct Known Subclasses:
RelationshipAttributeDef, RelationshipEndDef

public class AttributeDef extends AtlanObject implements Comparable<AttributeDef>
Defines the structure of a single attribute for a type definition in Atlan.
See Also:
  • Constructor Details

  • Method Details

    • of

      public static AttributeDef of(String displayName, AtlanCustomAttributePrimitiveType type, boolean multiValued) throws AtlanException
      Instantiate an attribute definition from the provided parameters.
      Parameters:
      displayName - human-readable name of the attribute
      type - primitive type of the attribute (non-enum)
      multiValued - true if multiple values are allowed for the attribute, otherwise false
      Returns:
      the attribute definition
      Throws:
      AtlanException - if there is any API error trying to construct the attribute (usually due to a non-existent enumeration)
    • of

      public static AttributeDef of(AtlanClient client, String displayName, AtlanCustomAttributePrimitiveType type, boolean multiValued) throws AtlanException
      Instantiate an attribute definition from the provided parameters.
      Parameters:
      client - connectivity to the Atlan tenant on which this attribute is intended to be created
      displayName - human-readable name of the attribute
      type - primitive type of the attribute (non-enum)
      multiValued - true if multiple values are allowed for the attribute, otherwise false
      Returns:
      the attribute definition
      Throws:
      AtlanException - if there is any API error trying to construct the attribute (usually due to a non-existent enumeration)
    • of

      public static AttributeDef of(String displayName, AtlanCustomAttributePrimitiveType type, boolean multiValued, AttributeDefOptions otherOptions) throws AtlanException
      Instantiate an attribute definition from the provided parameters.
      Parameters:
      displayName - human-readable name of the attribute
      type - primitive type of the attribute (non-enum)
      multiValued - true if multiple values are allowed for the attribute, otherwise false
      otherOptions - other options to set on the attribute
      Returns:
      the attribute definition
      Throws:
      AtlanException - if there is any API error trying to construct the attribute (usually due to a non-existent enumeration)
    • of

      public static AttributeDef of(AtlanClient client, String displayName, AtlanCustomAttributePrimitiveType type, boolean multiValued, AttributeDefOptions otherOptions) throws AtlanException
      Instantiate an attribute definition from the provided parameters.
      Parameters:
      client - connectivity to the Atlan tenant on which this attribute is intended to be created
      displayName - human-readable name of the attribute
      type - primitive type of the attribute (non-enum)
      multiValued - true if multiple values are allowed for the attribute, otherwise false
      otherOptions - other options to set on the attribute
      Returns:
      the attribute definition
      Throws:
      AtlanException - if there is any API error trying to construct the attribute (usually due to a non-existent enumeration)
    • of

      public static AttributeDef of(String displayName, AtlanCustomAttributePrimitiveType type, String optionsName, boolean multiValued) throws AtlanException
      Instantiate an attribute definition from the provided parameters.
      Parameters:
      displayName - human-readable name of the attribute
      type - primitive type of the attribute
      optionsName - name of the options (enumeration) if the primitive type is an enumeration (can be null otherwise)
      multiValued - true if multiple values are allowed for the attribute, otherwise false
      Returns:
      the attribute definition
      Throws:
      AtlanException - if there is any API error trying to construct the attribute (usually due to a non-existent enumeration)
    • of

      public static AttributeDef of(AtlanClient client, String displayName, AtlanCustomAttributePrimitiveType type, String optionsName, boolean multiValued) throws AtlanException
      Instantiate an attribute definition from the provided parameters.
      Parameters:
      client - connectivity to the Atlan tenant on which this attribute is intended to be created
      displayName - human-readable name of the attribute
      type - primitive type of the attribute
      optionsName - name of the options (enumeration) if the primitive type is an enumeration (can be null otherwise)
      multiValued - true if multiple values are allowed for the attribute, otherwise false
      Returns:
      the attribute definition
      Throws:
      AtlanException - if there is any API error trying to construct the attribute (usually due to a non-existent enumeration)
    • of

      public static AttributeDef of(String displayName, AtlanCustomAttributePrimitiveType type, String optionsName, boolean multiValued, AttributeDefOptions otherOptions) throws AtlanException
      Instantiate an attribute definition from the provided parameters.
      Parameters:
      displayName - human-readable name of the attribute
      type - primitive type of the attribute
      optionsName - name of the options (enumeration) if the primitive type is an enumeration (can be null otherwise)
      multiValued - true if multiple values are allowed for the attribute, otherwise false
      otherOptions - other options to set on the attribute
      Returns:
      the attribute definition
      Throws:
      AtlanException - if there is any API error trying to construct the attribute (usually due to a non-existent enumeration)
    • of

      public static AttributeDef of(AtlanClient client, String displayName, AtlanCustomAttributePrimitiveType type, String optionsName, boolean multiValued, AttributeDefOptions otherOptions) throws AtlanException
      Instantiate an attribute definition from the provided parameters.
      Parameters:
      client - connectivity to the Atlan tenant on which this attribute is intended to be created
      displayName - human-readable name of the attribute
      type - primitive type of the attribute
      optionsName - name of the options (enumeration) if the primitive type is an enumeration (can be null otherwise)
      multiValued - true if multiple values are allowed for the attribute, otherwise false
      otherOptions - other options to set on the attribute
      Returns:
      the attribute definition
      Throws:
      AtlanException - if there is any API error trying to construct the attribute (usually due to a non-existent enumeration)
    • creator

      public static AttributeDef.AttributeDefBuilder<?,?> creator(String name, AtlanAttributeType type)
      Build up an attribute definition from the provided parameters and default settings for all other parameters. NOTE: INTERNAL USE ONLY.
      Parameters:
      name - name of the attribute
      type - primitive type of the attribute (non-enum, non-struct)
      Returns:
      a builder for an attribute definition
    • creator

      public static AttributeDef.AttributeDefBuilder<?,?> creator(String name, AtlanAttributeType type, String relatedObjectType, AtlanCustomAttributeCardinality cardinality)
      Build up an attribute definition from the provided parameters and default settings for all other parameters. NOTE: INTERNAL USE ONLY.
      Parameters:
      name - name of the attribute
      type - type of the attribute
      relatedObjectType - name of the enumeration or struct, if the attribute type is an enumeration or struct (can be null otherwise)
      cardinality - whether the attribute is single or multivalued
      Returns:
      a builder for an attribute definition
    • isArchived

      public boolean isArchived()
      Whether this attribute is archived (true) or active (false).
      Returns:
      boolean
    • getBasicType

      public String getBasicType()
      Determine the basic type of this attribute (irrespective of whether it is multivalued or not). For example, the basic type of array<string> is just string.
      Returns:
      the basic type of this attribute
    • getContainerType

      public String getContainerType()
      Determine the container of this attribute, if any. For example, the container of array<string> is a list or sorted set.
      Returns:
      the container of this attribute, if any, or null if it is a single-valued attribute
    • getBasicType

      public static String getBasicType(String type)
      Determine the basic type of the attribute (irrespective of whether it is multivalued or not). For example, the basic type of array<string> is just string.
      Parameters:
      type - typeName of the attribute
      Returns:
      the basic type of this attribute
    • getContainerType

      public static String getContainerType(String type)
      Determine the container of the attribute, if any. For example, the container of array<string> is a list or sorted set.
      Parameters:
      type - typeName of the attribute
      Returns:
      the container of this attribute, if any, or null if it is a single-valued attribute
    • compareTo

      public int compareTo(AttributeDef o)
      Specified by:
      compareTo in interface Comparable<AttributeDef>
    • builder

      public static AttributeDef.AttributeDefBuilder<?,?> builder()
    • toBuilder

      public AttributeDef.AttributeDefBuilder<?,?> toBuilder()
    • getName

      public String getName()
      Internal hashed-string name for the attribute.
    • getDisplayName

      public String getDisplayName()
      Human-readable name of the attribute.
    • getDescription

      public String getDescription()
      Explanation of the attribute.
    • getTypeName

      public String getTypeName()
      Type of the attribute.
      • This can either be a primitive Atlan type or the name of a custom metadata enumeration (options).
      • The primitive Atlan types' values are defined in the AtlanCustomAttributePrimitiveType enumeration.
      • Note: there are a number of custom types there as well (users, groups, url, and SQL). The typeName for all of these custom types is STRING, and the more detailed type only appears in the options.
      • For fields that can be multivalued, use array<type> for the typeName.
    • getDefaultValue

      public String getDefaultValue()
      Specifies an (optional) default value for the attribute.
    • getIsDefaultValueNull

      public Boolean getIsDefaultValueNull()
      Indicates whether the attribute has a default value of being empty (true) or not (false).
    • getIsOptional

      public Boolean getIsOptional()
      Indicates whether the attribute is mandatory (false) or optional (true).
    • getCardinality

      public AtlanCustomAttributeCardinality getCardinality()
      Specifies whether the attribute is single or multivalued.
    • getValuesMinCount

      public Long getValuesMinCount()
      Specifies the minimum number of values the attribute can have.
    • getValuesMaxCount

      public Long getValuesMaxCount()
      Specifies the maximum number of values the attribute can have.
    • getIsUnique

      public Boolean getIsUnique()
      Specifies whether the attribute must have unique values (true) or not (false).
    • getIsIndexable

      public Boolean getIsIndexable()
      Specifies whether the attribute can be searched (true) or not (false).
    • getIncludeInNotification

      public Boolean getIncludeInNotification()
      Whether changes to this attribute's value generate an event (true) or not (false).
    • getSkipScrubbing

      public Boolean getSkipScrubbing()
      TBC
    • getSearchWeight

      public Long getSearchWeight()
      TBC
    • getIndexType

      public String getIndexType()
      TBC
    • getOptions

      public AttributeDefOptions getOptions()
      Options for the attribute.
    • getIsNew

      public Boolean getIsNew()
      Whether the attribute is being newly created (true) or not (false).
    • getEnumValues

      public List<String> getEnumValues()
      List of values for an enumeration.
    • getConstraints

      public List<Constraint> getConstraints()
      TBC
    • getIndexTypeESConfig

      public Map<String,String> getIndexTypeESConfig()
      TBC
    • getIndexTypeESFields

      public Map<String,Map<String,String>> getIndexTypeESFields()
      TBC
    • getAutoUpdateAttributes

      public Map<String,List<String>> getAutoUpdateAttributes()
      TBC
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AtlanObject
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class AtlanObject
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AtlanObject
    • toString

      public String toString()
      Description copied from class: AtlanObject
      Overrides:
      toString in class AtlanObject