Class MutableComposite

    • Constructor Detail

      • MutableComposite

        public MutableComposite​(T... fields)
        Construct a composite with the described schema using the supplied Named and ScalarSettable objects. The record type will be inferred from the provided fields.
        Parameters:
        fields - the named ScalarSettable objects to contain field values
      • MutableComposite

        public MutableComposite​(RecordTokenType type,
                                ScalarSettable[] fields)
        Construct a composite with the described schema using the supplied ScalarSettable objects. The field types in the schema will be cross-validated against the given objects.
        Parameters:
        type - the record schema to use for the resulting composite
        fields - the ScalarSettable objects to contain field values
        Throws:
        DRException - if the provided field types disagree with the types of the field objects
    • Method Detail

      • size

        public int size()
        Description copied from interface: RecordSettable
        Gets the number of fields in the record schema.
        Specified by:
        size in interface RecordSettable
        Returns:
        the number of fields
      • getField

        public ScalarSettable getField​(String fieldName)
        Description copied from interface: RecordSettable
        Gets the settable for the field with the given name.
        Specified by:
        getField in interface RecordSettable
        Parameters:
        fieldName - the field name
        Returns:
        the settable field
      • getField

        public ScalarSettable getField​(int index)
        Description copied from interface: RecordSettable
        Get the field at the given index within the list of fields.
        Specified by:
        getField in interface RecordSettable
        Parameters:
        index - zero-based index into the field list
        Returns:
        the settable field
      • set

        public void set​(TokenValued value)
        Description copied from interface: TokenSettable
        Sets the contained value to the given token value. The given value must have a type compatible with this object.
        Specified by:
        set in interface TokenSettable
        Parameters:
        value - the value to which to set the container
      • setNull

        public void setNull()
        Description copied from interface: TokenSettable
        Sets the contained value to be null valued.
        Specified by:
        setNull in interface TokenSettable
      • setZero

        public void setZero()
        Description copied from interface: TokenSettable
        Sets the contained value to be zero valued.
        Specified by:
        setZero in interface TokenSettable