Interface FieldBuilder

  • All Known Implementing Classes:
    BaseFieldBuilder

    public interface FieldBuilder
    Interface for in-line creating of introspection interfaces. One instance can be used to create multiple Field instances. An instance of this object must not be used concurrently (an object has a state).
    Author:
    mse
    • Method Detail

      • setId

        FieldBuilder setId​(String id)
        Set ID of an object to be created.
        Parameters:
        id - the id to be set
        Returns:
        this instance of a FieldBuilder
      • add

        FieldBuilder add​(String name,
                         ScalarType scalarType)
        Add a Scalar.
        Parameters:
        name - the name of the array
        scalarType - the type of the scalar to add
        Returns:
        this instance of a FieldBuilder
      • addBoundedString

        FieldBuilder addBoundedString​(String name,
                                      int maxLength)
        Add a bounded string.
        Parameters:
        name - the name of the bounded string
        maxLength - the maximum string length
        Returns:
        this instance of a FieldBuilder
      • add

        FieldBuilder add​(String name,
                         Field field)
        Add a Field (e.g. Structure, Union).
        Parameters:
        name - the name of the array
        field - a field to add
        Returns:
        this instance of a FieldBuilder
      • addArray

        FieldBuilder addArray​(String name,
                              ScalarType scalarType)
        Add variable size array of Scalar elements.
        Parameters:
        name - the name of the array
        scalarType - the type of the scalar element
        Returns:
        this instance of a FieldBuilder
      • addFixedArray

        FieldBuilder addFixedArray​(String name,
                                   ScalarType scalarType,
                                   int size)
        Add fixed-size array of Scalar elements.
        Parameters:
        name - the name of the array
        scalarType - type of the scalar element
        size - the size of the Array to add
        Returns:
        this instance of a FieldBuilder
      • addBoundedArray

        FieldBuilder addBoundedArray​(String name,
                                     ScalarType scalarType,
                                     int bound)
        Add bounded-size array of Scalar elements.
        Parameters:
        name - the name of the array
        scalarType - the type of the scalar element
        bound - the maximum capacity (size) of the array
        Returns:
        this instance of a FieldBuilder
      • addArray

        FieldBuilder addArray​(String name,
                              Field field)
        Add array of Field elements.
        Parameters:
        name - the name of the array
        field - the type of each array element
        Returns:
        this instance of a FieldBuilder
      • createStructure

        Structure createStructure()
        Create a Structure. This resets this instance state and allows new Field instance to be created.
        Returns:
        the new instance of a Structure created
      • createUnion

        Union createUnion()
        Create an Union. This resets this instance state and allows new Field instance to be created.
        Returns:
        the new instance of an Union created
      • addNestedStructure

        FieldBuilder addNestedStructure​(String name)
        Add new nested Structure. createNested() method must be called to complete creation of the nested Structure.
        Parameters:
        name - the nested structure name
        Returns:
        a new instance of a FieldBuilder is returned
        See Also:
        endNested()
      • addNestedUnion

        FieldBuilder addNestedUnion​(String name)
        Add new nested Union. createNested() method must be called to complete creation of the nested Union.
        Parameters:
        name - the nested union name
        Returns:
        a new instance of a FieldBuilder is returned
        See Also:
        endNested()
      • addNestedStructureArray

        FieldBuilder addNestedStructureArray​(String name)
        Add new nested Structure[]. createNested() method must be called to complete creation of the nested Structure.
        Parameters:
        name - the nested structure array name
        Returns:
        a new instance of a FieldBuilder is returned
        See Also:
        endNested()
      • addNestedUnionArray

        FieldBuilder addNestedUnionArray​(String name)
        Add new nested Union[]. createNested() method must be called to complete creation of the nested Union.
        Parameters:
        name - the nested union array name.
        Returns:
        a new instance of a FieldBuilder is returned.
        See Also:
        endNested()