Class DataProperty.Builder

java.lang.Object
com.luciad.datamodels.DataProperty.Builder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
DataProperty

public static final class DataProperty.Builder extends Object implements AutoCloseable
Builder that allows DataProperty instances to be created.

Typical usage would be to create a DataProperty.Builder using DataProperty#newBuilder, specifying the name of the data property. Then, specify the value type and finally build() the data property. The following snippet shows how this is done for a simple example data property:

    return DataProperty.newBuilder()
                       .name("geometry")
                       .valueType(DataType.getGeometryType())
                       .build();
  • Constructor Details

    • Builder

      public Builder(@NotNull DataProperty.Builder other)
      Copy constructor.
      Parameters:
      other - the builder to copy.
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • build

      @NotNull public DataProperty build() throws IllegalStateException
      Build the data type, including the value type that was set on this builder.

      After calling this function, you should no longer use this builder.

      Returns:
      the data type.
      Throws:
      IllegalStateException - If not all mandatory parameters are set.
    • valueType

      @NotNull public DataProperty.Builder valueType(@NotNull DataType type)
      Sets the data type for the data property under construction.

      For a list-typed property (see collectionKind(DataCollectionKind)), this is the type of the elements in the list.

      Calling this function is mandatory.

      Parameters:
      type - the data type for the data property under construction.
      Returns:
      this builder.
    • name

      @NotNull public DataProperty.Builder name(@NotNull String name)
      Sets the name of the data property.

      Calling this function is mandatory.

      Parameters:
      name - name of the data property.
      Returns:
      this builder.
    • collectionKind

      @NotNull public DataProperty.Builder collectionKind(@NotNull DataCollectionKind type)
      Sets the collection type of the data property under construction.

      Calling this function is optional. The default is DataCollectionKind#Scalar.

      Parameters:
      type - the collection type for the data property under construction.
      Returns:
      this builder.
      Since:
      2026.1
    • addAnnotation

      @NotNull public DataProperty.Builder addAnnotation(@NotNull DataAnnotation annotation) throws NullPointerException
      Adds an annotation to the data property under construction.
      Parameters:
      annotation - the annotation to add.
      Returns:
      this builder.
      Throws:
      NullPointerException - when a null value is passed.
      Since:
      2026.1