Class FieldDescription
- java.lang.Object
-
- com.esri.arcgisruntime.data.FieldDescription
-
public final class FieldDescription extends java.lang.Object
An object that describes aField
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 Summary
Constructors Constructor Description FieldDescription(java.lang.String name, Field.Type fieldType)
Creates a new field description object with the specified name and type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAlias()
Gets the field's alias.java.lang.String
getDomainName()
Gets the name of the domain to use on this field.boolean
getEditable()
True if the field is editable.Field.Type
getFieldType()
Gets the field's data type.int
getLength()
Gets the length of the field.java.lang.String
getName()
Gets the field's name.boolean
getNullable()
True if the field is nullable.void
setAlias(java.lang.String alias)
Sets the field's alias.void
setDomainName(java.lang.String domainName)
Sets the name of the domain to use on this field.void
setEditable(boolean editable)
True if the field is editable.void
setFieldType(Field.Type fieldType)
Sets the field's data type.void
setLength(int length)
Sets the length of the field.void
setName(java.lang.String name)
Sets the field's name.void
setNullable(boolean nullable)
True if the field is nullable.
-
-
-
Constructor Detail
-
FieldDescription
public FieldDescription(java.lang.String name, Field.Type fieldType)
Creates a new field description object with the specified name and type.- Parameters:
name
- the field's namefieldType
- the field's data type- Throws:
java.lang.IllegalArgumentException
- if name is nulljava.lang.IllegalArgumentException
- if fieldType is null- Since:
- 100.14.0
-
-
Method Detail
-
getAlias
public java.lang.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(java.lang.String alias)
Sets the field's alias.The default value is an empty string.
- Parameters:
alias
- the field's alias- Throws:
java.lang.IllegalArgumentException
- if alias is null- Since:
- 100.14.0
-
getDomainName
public java.lang.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(java.lang.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:
java.lang.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:
java.lang.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 java.lang.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(java.lang.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:
java.lang.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
-
-