Class FieldDescription

java.lang.Object
com.esri.arcgisruntime.data.FieldDescription

public final class FieldDescription extends Object
An object that describes a Field to be created.

Creation of fields and tables is currently only supported on mobile geodatabases, either created in ArcGIS Pro or via Geodatabase.createAsync(String).

Since:
100.14.0
  • Constructor Details

    • FieldDescription

      public FieldDescription(String name, Field.Type fieldType)
      Creates a new field description object with the specified name and type.
      Parameters:
      name - the field's name
      fieldType - the field's data type
      Throws:
      IllegalArgumentException - if name is null
      IllegalArgumentException - if fieldType is null
      Since:
      100.14.0
  • Method Details

    • getAlias

      public String getAlias()
      Gets the field's alias.

      The default value is an empty string.

      Returns:
      the field's alias
      Since:
      100.14.0
    • setAlias

      public void setAlias(String alias)
      Sets the field's alias.

      The default value is an empty string.

      Parameters:
      alias - the field's alias
      Throws:
      IllegalArgumentException - if alias is null
      Since:
      100.14.0
    • getDomainName

      public String getDomainName()
      Gets the name of the domain to use on this field.

      The domain must already exist in the geodatabase (see Geodatabase.createDomainAsync(DomainDescription)). The default value of an empty string indicates that no domain should be used.

      Returns:
      the name of the domain to use on this field
      Since:
      100.14.0
    • setDomainName

      public void setDomainName(String domainName)
      Sets the name of the domain to use on this field.

      The domain must already exist in the geodatabase (see Geodatabase.createDomainAsync(DomainDescription)). The default value of an empty string indicates that no domain should be used.

      Parameters:
      domainName - the name of the domain to use on this field
      Throws:
      IllegalArgumentException - if domainName is null
      Since:
      100.14.0
    • getEditable

      public boolean getEditable()
      True if the field is editable.

      The default value is true.

      Returns:
      true if the field is editable
      Since:
      100.14.0
    • setEditable

      public void setEditable(boolean editable)
      True if the field is editable.

      The default value is true.

      Parameters:
      editable - true if the field is editable
      Since:
      100.14.0
    • getFieldType

      public Field.Type getFieldType()
      Gets the field's data type.

      The default is Field.Type.UNKNOWN, and must be set to a valid type.

      Returns:
      the field's data type
      Since:
      100.14.0
    • setFieldType

      public void setFieldType(Field.Type fieldType)
      Sets the field's data type.

      The default is Field.Type.UNKNOWN, and must be set to a valid type.

      Parameters:
      fieldType - the field's data type
      Throws:
      IllegalArgumentException - if fieldType is null
      Since:
      100.14.0
    • getLength

      public int getLength()
      Gets the length of the field.

      The default value is 0. This only applies to text fields.

      Returns:
      the length of the field
      Since:
      100.14.0
    • setLength

      public void setLength(int length)
      Sets the length of the field.

      The default value is 0. This only applies to text fields.

      Parameters:
      length - the length of the field
      Since:
      100.14.0
    • getName

      public String getName()
      Gets the field's name.

      Field names must be non-empty, consist only of alphanumeric characters and underscores, and cannot start with a number or an underscore.

      Returns:
      the field's name
      Since:
      100.14.0
    • setName

      public void setName(String name)
      Sets the field's name.

      Field names must be non-empty, consist only of alphanumeric characters and underscores, and cannot start with a number or an underscore.

      Parameters:
      name - the field's name
      Throws:
      IllegalArgumentException - if name is null
      Since:
      100.14.0
    • getNullable

      public boolean getNullable()
      True if the field is nullable.

      The default value is true.

      Returns:
      true if the field is nullable
      Since:
      100.14.0
    • setNullable

      public void setNullable(boolean nullable)
      True if the field is nullable.

      The default value is true.

      Parameters:
      nullable - true if the field is nullable
      Since:
      100.14.0