Class Field


  • public final class Field
    extends java.lang.Object
    Represents a single field of a FeatureTable. You need to pass this object to all feature type methods.
    Since:
    100.0.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Field.Type
      The different row value types.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Field createDate​(java.lang.String name, java.lang.String alias)
      Creates a Field of type Field.Type.DATE which corresponds to the Java type Calendar.
      static Field createDouble​(java.lang.String name, java.lang.String alias)
      Creates a Field of type Field.Type.DOUBLE which corresponds to the Java type Double.
      static Field createFloat​(java.lang.String name, java.lang.String alias)
      Creates a Field of type Field.Type.FLOAT which corresponds to the Java type Float.
      static Field createInteger​(java.lang.String name, java.lang.String alias)
      Creates a Field of type Field.Type.INTEGER which corresponds to the Java type Integer.
      static Field createShort​(java.lang.String name, java.lang.String alias)
      Creates a Field of type Field.Type.SHORT which corresponds to the Java type Short.
      static Field createString​(java.lang.String name, java.lang.String alias, int length)
      Creates a Field of type Field.Type.TEXT which corresponds to the Java type String.
      static Field fromJson​(java.lang.String json)
      Creates a Field instance from a JSON string.
      java.lang.String getAlias()
      Gets the alias of the Field, a user-friendly string often used for display in a user interface.
      Domain getDomain()
      Gets the domain of the Field.
      Field.Type getFieldType()
      Gets the type of the Field.
      int getLength()
      Gets the length of the Field.
      java.lang.String getName()
      Gets the name of the Field.
      boolean isEditable()
      Gets whether or not the Field is editable.
      boolean isNullable()
      Gets whether or not the Field may be set to null.
      java.lang.String toJson()
      Serializes this Field to a JSON string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createDate

        public static Field createDate​(java.lang.String name,
                                       java.lang.String alias)
        Creates a Field of type Field.Type.DATE which corresponds to the Java type Calendar.

        The field will be editable and nullable.

        Parameters:
        name - the name of the field
        alias - the alias of the field, if null or empty it will be substituted by the field name
        Returns:
        a date Field
        Throws:
        java.lang.IllegalArgumentException - if name is null or empty
        Since:
        100.0.0
      • createDouble

        public static Field createDouble​(java.lang.String name,
                                         java.lang.String alias)
        Creates a Field of type Field.Type.DOUBLE which corresponds to the Java type Double.

        The field will be editable and nullable.

        Parameters:
        name - the name of the field
        alias - the alias of the field, if null or empty it will be substituted by the field name
        Returns:
        a double-precision floating point field
        Throws:
        java.lang.IllegalArgumentException - if name is null or empty
        Since:
        100.0.0
      • createFloat

        public static Field createFloat​(java.lang.String name,
                                        java.lang.String alias)
        Creates a Field of type Field.Type.FLOAT which corresponds to the Java type Float.

        The field will be editable and nullable.

        Parameters:
        name - the name of the field
        alias - the alias of the field, if null or empty it will be substituted by the field name
        Returns:
        a single-precision floating point field
        Throws:
        java.lang.IllegalArgumentException - if name is null or empty
        Since:
        100.0.0
      • createInteger

        public static Field createInteger​(java.lang.String name,
                                          java.lang.String alias)
        Creates a Field of type Field.Type.INTEGER which corresponds to the Java type Integer.

        The field will be editable and nullable.

        Parameters:
        name - the name of the field
        alias - the alias of the field, if null or empty it will be substituted by the field name
        Returns:
        a 32-bit integer field
        Throws:
        java.lang.IllegalArgumentException - if name is null or empty
        Since:
        100.0.0
      • createShort

        public static Field createShort​(java.lang.String name,
                                        java.lang.String alias)
        Creates a Field of type Field.Type.SHORT which corresponds to the Java type Short.

        The field will be editable and nullable.

        Parameters:
        name - the name of the field
        alias - the alias of the field, if null or empty it will be substituted by the field name
        Returns:
        a 16-bit integer field
        Throws:
        java.lang.IllegalArgumentException - if name is null or empty
        Since:
        100.0.0
      • createString

        public static Field createString​(java.lang.String name,
                                         java.lang.String alias,
                                         int length)
        Creates a Field of type Field.Type.TEXT which corresponds to the Java type String.

        The field will be editable and nullable.

        Parameters:
        name - the name of the field
        alias - the alias of the field, if null or empty it will be substituted by the field name
        length - the maximum number of characters in the field
        Returns:
        a text field
        Throws:
        java.lang.IllegalArgumentException - if name is null or empty
        Since:
        100.0.0
      • toJson

        public java.lang.String toJson()
        Serializes this Field to a JSON string.
        Returns:
        the JSON representation of this Field
        Since:
        100.0.0
      • fromJson

        public static Field fromJson​(java.lang.String json)
        Creates a Field instance from a JSON string.
        Parameters:
        json - the JSON representation of a Field
        Returns:
        a Field instance deserialized from the JSON string
        Throws:
        java.lang.IllegalArgumentException - if json is null or empty
        Since:
        100.0.0
      • getAlias

        public java.lang.String getAlias()
        Gets the alias of the Field, a user-friendly string often used for display in a user interface.
        Returns:
        the alias of the Field
        Since:
        100.0.0
      • getDomain

        public Domain getDomain()
        Gets the domain of the Field. A domain represents the valid values for a Field. Non ArcGISFeatureTables do not have domains.
        Returns:
        the domain of the Field for ArcGISFeatureTables; null if there is no domain
        Since:
        100.0.0
      • getFieldType

        public Field.Type getFieldType()
        Gets the type of the Field.
        Returns:
        the type of the Field
        Since:
        100.0.0
      • getLength

        public int getLength()
        Gets the length of the Field. Only valid for Field.Type.TEXT type fields.
        Returns:
        the length of the Field
        Since:
        100.0.0
      • getName

        public java.lang.String getName()
        Gets the name of the Field.
        Returns:
        the name of the Field
        Since:
        100.0.0
      • isEditable

        public boolean isEditable()
        Gets whether or not the Field is editable.
        Returns:
        true if the field is editable, otherwise false
        Since:
        100.0.0
      • isNullable

        public boolean isNullable()
        Gets whether or not the Field may be set to null.
        Returns:
        true if the Field is nullable, otherwise false
        Since:
        100.0.0