Class BaseFieldBuilder

  • All Implemented Interfaces:
    FieldBuilder

    public class BaseFieldBuilder
    extends Object
    implements FieldBuilder
    FieldBuilder implementation.
    Author:
    mse
    • Constructor Detail

      • BaseFieldBuilder

        public BaseFieldBuilder()
        Constructor
    • Method Detail

      • setId

        public FieldBuilder setId​(String id)
        Description copied from interface: FieldBuilder
        Set ID of an object to be created.
        Specified by:
        setId in interface FieldBuilder
        Parameters:
        id - the id to be set
        Returns:
        this instance of a FieldBuilder
      • add

        public FieldBuilder add​(String name,
                                ScalarType scalarType)
        Description copied from interface: FieldBuilder
        Add a Scalar.
        Specified by:
        add in interface FieldBuilder
        Parameters:
        name - the name of the array
        scalarType - the type of the scalar to add
        Returns:
        this instance of a FieldBuilder
      • addBoundedString

        public FieldBuilder addBoundedString​(String name,
                                             int maxLength)
        Description copied from interface: FieldBuilder
        Add a bounded string.
        Specified by:
        addBoundedString in interface FieldBuilder
        Parameters:
        name - the name of the bounded string
        maxLength - the maximum string length
        Returns:
        this instance of a FieldBuilder
      • add

        public FieldBuilder add​(String name,
                                Field field)
        Description copied from interface: FieldBuilder
        Add a Field (e.g. Structure, Union).
        Specified by:
        add in interface FieldBuilder
        Parameters:
        name - the name of the array
        field - a field to add
        Returns:
        this instance of a FieldBuilder
      • addArray

        public FieldBuilder addArray​(String name,
                                     ScalarType scalarType)
        Description copied from interface: FieldBuilder
        Add variable size array of Scalar elements.
        Specified by:
        addArray in interface FieldBuilder
        Parameters:
        name - the name of the array
        scalarType - the type of the scalar element
        Returns:
        this instance of a FieldBuilder
      • addFixedArray

        public FieldBuilder addFixedArray​(String name,
                                          ScalarType scalarType,
                                          int size)
        Description copied from interface: FieldBuilder
        Add fixed-size array of Scalar elements.
        Specified by:
        addFixedArray in interface FieldBuilder
        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

        public FieldBuilder addBoundedArray​(String name,
                                            ScalarType scalarType,
                                            int bound)
        Description copied from interface: FieldBuilder
        Add bounded-size array of Scalar elements.
        Specified by:
        addBoundedArray in interface FieldBuilder
        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

        public FieldBuilder addArray​(String name,
                                     Field element)
        Description copied from interface: FieldBuilder
        Add array of Field elements.
        Specified by:
        addArray in interface FieldBuilder
        Parameters:
        name - the name of the array
        element - the type of each array element
        Returns:
        this instance of a FieldBuilder
      • createStructure

        public Structure createStructure()
        Description copied from interface: FieldBuilder
        Create a Structure. This resets this instance state and allows new Field instance to be created.
        Specified by:
        createStructure in interface FieldBuilder
        Returns:
        the new instance of a Structure created
      • createUnion

        public Union createUnion()
        Description copied from interface: FieldBuilder
        Create an Union. This resets this instance state and allows new Field instance to be created.
        Specified by:
        createUnion in interface FieldBuilder
        Returns:
        the new instance of an Union created
      • addNestedStructure

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

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

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

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