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 Summary
ConstructorDescriptionFieldDescription
(String name, Field.Type fieldType) Creates a new field description object with the specified name and type. -
Method Summary
Modifier and TypeMethodDescriptiongetAlias()
Gets the field's alias.Gets the name of the domain to use on this field.boolean
True if the field is editable.Gets the field's data type.int
Gets the length of the field.getName()
Gets the field's name.boolean
True if the field is nullable.void
Sets the field's alias.void
setDomainName
(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
Sets the field's name.void
setNullable
(boolean nullable) True if the field is nullable.
-
Constructor Details
-
FieldDescription
Creates a new field description object with the specified name and type.- Parameters:
name
- the field's namefieldType
- the field's data type- Throws:
IllegalArgumentException
- if name is nullIllegalArgumentException
- if fieldType is null- Since:
- 100.14.0
-
-
Method Details
-
getAlias
Gets the field's alias.The default value is an empty string.
- Returns:
- the field's alias
- Since:
- 100.14.0
-
setAlias
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
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
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
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
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
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
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
-