Interface RecordValue

  • All Superinterfaces:
    java.lang.Comparable<FieldValue>, FieldValue
    All Known Subinterfaces:
    IndexKey, PrimaryKey, ReturnRow, Row

    public interface RecordValue
    extends FieldValue
    RecordValue extends FieldValue to represent a record value. A record value is an ordered collection of key-value pairs called "fields". The keys are called "field names"; they are all strings and must be unique within each record. The associated values, called "field values", do not need to have the same type. Each record is associated with, and conforms to, a record type definition (see RecordDef). The record type definition specifies the number, names, and ordering of the fields in all conforming records, as well as the type of each field value. The field order is the order in which the fields appear in record type declaration. Based on this order, each field has a unique position, which is a number between 0 and N - 1, where N is the number of fields. Note: during its construction, a record may have fewer fields than what its associated type dictates. Fields can be added to a record via the various put() methods defined by the RecordValue interface.
    Since:
    3.0
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      void clear()
      Deletes all the fields from this record.
      RecordValue clone()
      Returns a deep copy of this object.
      boolean contains​(int position)
      Returns true if the record contains a field at the given position.
      boolean contains​(java.lang.String fieldName)
      Returns true if the record contains the named field.
      void copyFrom​(RecordValue source)
      Copies the fields from another RecordValue instance, overwriting fields in this object with the same name.
      FieldValue get​(int position)
      Returns the value of the field at the given position.
      FieldValue get​(java.lang.String fieldName)
      Returns the value of the field with the given name.
      RecordDef getDefinition()
      Returns the record type that this record conforms to.
      java.lang.String getFieldName​(int position)
      Returns the name of the field at the given position
      java.util.List<java.lang.String> getFieldNames()
      Returns the list of all field names that are defined by the associated record type.
      int getFieldPos​(java.lang.String fieldName)
      Returns the position of the field with the given name
      java.util.List<java.lang.String> getFields()
      Deprecated.
      as of 4.2 Please use the equivalent getFieldNames() method.
      boolean isEmpty()
      Returns true if none of the record's fields have been set, false otherwise.
      RecordValue put​(int position, boolean value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue put​(int position, byte[] value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue put​(int position, double value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue put​(int position, float value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue put​(int position, int value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue put​(int position, long value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue put​(int position, java.lang.String value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue put​(int position, java.sql.Timestamp value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue put​(int position, FieldValue value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue put​(java.lang.String fieldName, boolean value)
      Set the named field, silently overwriting existing values.
      RecordValue put​(java.lang.String fieldName, byte[] value)
      Set the named field, silently overwriting existing values.
      RecordValue put​(java.lang.String fieldName, double value)
      Set the named field, silently overwriting existing values.
      RecordValue put​(java.lang.String fieldName, float value)
      Set the named field, silently overwriting existing values.
      RecordValue put​(java.lang.String fieldName, int value)
      Set the named field, silently overwriting existing values.
      RecordValue put​(java.lang.String fieldName, long value)
      Set the named field, silently overwriting existing values.
      RecordValue put​(java.lang.String fieldName, java.lang.String value)
      Set the named field, silently overwriting existing values.
      RecordValue put​(java.lang.String fieldName, java.sql.Timestamp value)
      Set the named field, silently overwriting existing values.
      RecordValue put​(java.lang.String fieldName, FieldValue value)
      Set the named field, silently overwriting existing values.
      ArrayValue putArray​(int position)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putArray​(int position, java.lang.Iterable<?> list)
      Inserts a list of Java objects into the record as an array at the given position, or updates its value if the field exists already.
      RecordValue putArray​(int position, java.lang.Object[] array)
      Inserts an array of Java objects into the record as an array at the given given position, or updates its value if the field exists already.
      ArrayValue putArray​(java.lang.String fieldName)
      Set an ArrayValue field, silently overwriting existing values.
      RecordValue putArray​(java.lang.String fieldName, java.lang.Iterable<?> list)
      Set an ArrayValue field based on list input, silently overwriting existing values.
      RecordValue putArray​(java.lang.String fieldName, java.lang.Object[] array)
      Set an ArrayValue field based on an array of Java Objects, silently overwriting existing values.
      RecordValue putArrayAsJson​(int position, java.io.InputStream jsonInput, boolean exact)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putArrayAsJson​(int position, java.lang.String jsonInput, boolean exact)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putArrayAsJson​(java.lang.String fieldName, java.io.InputStream jsonInput, boolean exact)
      Set a ArrayValue field, silently overwriting existing values.
      RecordValue putArrayAsJson​(java.lang.String fieldName, java.lang.String jsonInput, boolean exact)
      Set a ArrayValue field, silently overwriting existing values.
      RecordValue putEnum​(int position, java.lang.String value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putEnum​(java.lang.String fieldName, java.lang.String value)
      Set the named field, silently overwriting existing values.
      RecordValue putFixed​(int position, byte[] value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putFixed​(java.lang.String fieldName, byte[] value)
      Set the named field, silently overwriting existing values.
      RecordValue putJson​(int position, java.io.Reader jsonReader)
      Set a RecordValue field of type JSON using the JSON input.
      RecordValue putJson​(int position, java.lang.String jsonInput)
      Set a RecordValue field of type JSON using the JSON input.
      RecordValue putJson​(java.lang.String fieldName, java.io.Reader jsonReader)
      Set a RecordValue field of type JSON using the JSON input.
      RecordValue putJson​(java.lang.String fieldName, java.lang.String jsonInput)
      Set a RecordValue field of type JSON using the JSON input.
      RecordValue putJsonNull​(int position)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putJsonNull​(java.lang.String fieldName)
      Puts a JSON NULL value in the named field, silently overwriting existing values.
      MapValue putMap​(int position)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putMap​(int position, java.util.Map<java.lang.String,​?> map)
      Inserts the field at the given position, or updates its value if the field exists already.
      MapValue putMap​(java.lang.String fieldName)
      Set a MapValue field, silently overwriting existing values.
      RecordValue putMap​(java.lang.String fieldName, java.util.Map<java.lang.String,​?> map)
      Set a MapValue field based on map input, silently overwriting existing values.
      RecordValue putMapAsJson​(int position, java.io.InputStream jsonInput, boolean exact)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putMapAsJson​(int position, java.lang.String jsonInput, boolean exact)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putMapAsJson​(java.lang.String fieldName, java.io.InputStream jsonInput, boolean exact)
      Set a MapValue field, silently overwriting existing values.
      RecordValue putMapAsJson​(java.lang.String fieldName, java.lang.String jsonInput, boolean exact)
      Set a MapValue field, silently overwriting existing values.
      RecordValue putNull​(int position)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putNull​(java.lang.String fieldName)
      Put a null value in the named field, silently overwriting existing values.
      RecordValue putNumber​(int position, double value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putNumber​(int position, float value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putNumber​(int position, int value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putNumber​(int position, long value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putNumber​(int position, java.math.BigDecimal value)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putNumber​(java.lang.String fieldName, double value)
      Set the named field, silently overwriting existing values.
      RecordValue putNumber​(java.lang.String fieldName, float value)
      Set the named field, silently overwriting existing values.
      RecordValue putNumber​(java.lang.String fieldName, int value)
      Set the named field, silently overwriting existing values.
      RecordValue putNumber​(java.lang.String fieldName, long value)
      Set the named field, silently overwriting existing values.
      RecordValue putNumber​(java.lang.String fieldName, java.math.BigDecimal value)
      Set the named field, silently overwriting existing values.
      RecordValue putRecord​(int position)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putRecord​(int position, java.util.Map<java.lang.String,​?> map)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putRecord​(java.lang.String fieldName)
      Set a RecordValue field, silently overwriting existing values.
      RecordValue putRecord​(java.lang.String fieldName, java.util.Map<java.lang.String,​?> map)
      Set a RecordValue field based on map input, silently overwriting existing values.
      RecordValue putRecordAsJson​(int position, java.io.InputStream jsonInput, boolean exact)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putRecordAsJson​(int position, java.lang.String jsonInput, boolean exact)
      Inserts the field at the given position, or updates its value if the field exists already.
      RecordValue putRecordAsJson​(java.lang.String fieldName, java.io.InputStream jsonInput, boolean exact)
      Set a RecordValue field, silently overwriting existing values.
      RecordValue putRecordAsJson​(java.lang.String fieldName, java.lang.String jsonInput, boolean exact)
      Set a RecordValue field, silently overwriting existing values.
      FieldValue remove​(java.lang.String fieldName)
      Remove the named field if it exists.
      int size()
      Returns the number of the fields in this record.
      java.lang.String toString()
      Returns a String representation of this record.
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Method Detail

      • getDefinition

        RecordDef getDefinition()
        Returns the record type that this record conforms to.
        Specified by:
        getDefinition in interface FieldValue
        Returns:
        the RecordDef
      • getFields

        @Deprecated
        java.util.List<java.lang.String> getFields()
        Deprecated.
        as of 4.2 Please use the equivalent getFieldNames() method.
        Returns the list of all field names that are defined by the associated record type. The list is in field declaration order. Notice that this list does not depend on the actual fields present in this record, and is never empty. Values of the fields, if they are present in this instance, can be obtained using get(java.lang.String).
        Returns:
        an unmodifiable list of the field names in declaration order
        Since:
        3.0.6
      • getFieldNames

        java.util.List<java.lang.String> getFieldNames()
        Returns the list of all field names that are defined by the associated record type. The list is in field declaration order. Notice that this list does not depend on the actual fields present in this record, and is never empty. Values of the fields, if they are present in this instance, can be obtained using get(java.lang.String).
        Returns:
        an unmodifiable list of the field names in declaration order
        Since:
        4.2
      • getFieldName

        java.lang.String getFieldName​(int position)
        Returns the name of the field at the given position
        Parameters:
        position - the position of the field whose name is to be returned
        Returns:
        the name of the field at the given position
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        Since:
        4.2
      • getFieldPos

        int getFieldPos​(java.lang.String fieldName)
        Returns the position of the field with the given name
        Returns:
        the position of the field with the given name
        Throws:
        java.lang.IllegalArgumentException - if the associated record type does not have any field with the given name
        Since:
        4.2
      • clone

        RecordValue clone()
        Returns a deep copy of this object.
        Specified by:
        clone in interface FieldValue
        Returns:
        a deep copy of this object
      • clear

        void clear()
        Deletes all the fields from this record.
        Since:
        4.1
      • toString

        java.lang.String toString()
        Returns a String representation of this record. The value returned is a JSON string, and is the same as that returned by FieldValue.toJsonString(boolean).
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation of the value
      • get

        FieldValue get​(java.lang.String fieldName)
        Returns the value of the field with the given name.
        Parameters:
        fieldName - the name of the desired field
        Returns:
        the value of the specified field, if the field exists in this record, or null if it has not been added yet.
        Throws:
        java.lang.IllegalArgumentException - if the associated record type does not have any field with the given name
      • get

        FieldValue get​(int position)
        Returns the value of the field at the given position.
        Parameters:
        position - the position of the desired field.
        Returns:
        the field value if it is available, null if it has not been set
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        Since:
        4.0
      • size

        int size()
        Returns the number of the fields in this record. This is the number of fields that have actually been set, and is always less or equal to the number of fields in the associated record definition.
        Returns:
        the number of fields that have been set.
      • isEmpty

        boolean isEmpty()
        Returns true if none of the record's fields have been set, false otherwise.
        Returns:
        true if none of the record's fields have been set, false otherwise.
      • copyFrom

        void copyFrom​(RecordValue source)
        Copies the fields from another RecordValue instance, overwriting fields in this object with the same name. If a field exists in this record but not in the other record, the existing field is not removed.
        Parameters:
        source - the source RecordValue from which to copy
        Throws:
        java.lang.IllegalArgumentException - if the RecordDef of source does not match that of this instance.
      • contains

        boolean contains​(java.lang.String fieldName)
        Returns true if the record contains the named field.
        Parameters:
        fieldName - the name of the field
        Returns:
        true if the field exists in the record, otherwise null
        Throws:
        java.lang.IllegalArgumentException - if the associated record type does not have any field with the given name
      • contains

        boolean contains​(int position)
        Returns true if the record contains a field at the given position.
        Parameters:
        position - the position of the desired field.
        Returns:
        true if the field exists in the record, otherwise null
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        Since:
        4.2
      • remove

        FieldValue remove​(java.lang.String fieldName)
        Remove the named field if it exists.
        Parameters:
        fieldName - the name of the field to remove
        Returns:
        the FieldValue if the field existed (was set) in the record, otherwise null
        Throws:
        java.lang.IllegalArgumentException - if the associated record type does not have any field with the given name
      • put

        RecordValue put​(int position,
                        FieldValue value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.1
      • put

        RecordValue put​(int position,
                        int value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.2
      • put

        RecordValue put​(int position,
                        long value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.2
      • put

        RecordValue put​(int position,
                        java.lang.String value)
        Inserts the field at the given position, or updates its value if the field exists already. This method is used to put a string into a field of type String. The String value is not parsed or interpreted. The methods putJson(java.lang.String, java.lang.String) and putEnum(int, java.lang.String) exist to put String values of those types.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.2
      • put

        RecordValue put​(int position,
                        double value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.2
      • put

        RecordValue put​(int position,
                        float value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.2
      • put

        RecordValue put​(int position,
                        boolean value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.2
      • put

        RecordValue put​(int position,
                        byte[] value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.2
      • putFixed

        RecordValue putFixed​(int position,
                             byte[] value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.2
      • putEnum

        RecordValue putEnum​(int position,
                            java.lang.String value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.2
      • putNumber

        RecordValue putNumber​(int position,
                              int value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.4
      • putNumber

        RecordValue putNumber​(int position,
                              long value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.4
      • putNumber

        RecordValue putNumber​(int position,
                              float value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.4
      • putNumber

        RecordValue putNumber​(int position,
                              double value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.4
      • putNumber

        RecordValue putNumber​(int position,
                              java.math.BigDecimal value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.4
      • put

        RecordValue put​(int position,
                        java.sql.Timestamp value)
        Inserts the field at the given position, or updates its value if the field exists already.
        Parameters:
        position - the position of the field.
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the type of the specified field does not match that of the value.
        Since:
        4.3
      • putNull

        RecordValue putNull​(int position)
        Inserts the field at the given position, or updates its value if the field exists already. The new value of the field will be the special NULL value.
        Parameters:
        position - the position of the field.
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not nullable.
        Since:
        4.2
      • putJsonNull

        RecordValue putJsonNull​(int position)
        Inserts the field at the given position, or updates its value if the field exists already. The new value of the field will be the special JSON NULL value that returns true for FieldValue.isJsonNull(). The field must be of type JSON.
        Parameters:
        position - the position of the field.
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not of type JSON
        Since:
        4.3
      • putRecord

        RecordValue putRecord​(int position)
        Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a record-valued field, and the value assigned to it by this method is an empty record that conforms to the record type declared for this field.
        Parameters:
        position - the position of the field.
        Returns:
        the empty record assigned to the field.
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not record-valued.
        Since:
        4.2
      • putRecord

        RecordValue putRecord​(int position,
                              java.util.Map<java.lang.String,​?> map)
        Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a record-valued field, and the value assigned to it by this method is a new record that conforms to the record type declared for this field, and whose content is taken from the given java Map object..
        Parameters:
        position - the position of the field.
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not record-valued or if the map value doesn't match the record type of the field.
        Since:
        4.2
      • putRecordAsJson

        RecordValue putRecordAsJson​(int position,
                                    java.lang.String jsonInput,
                                    boolean exact)
        Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a record-valued field, and the value assigned to it by this method is a new record created and populated form a given JSON string. If the exact parameter is true, the input JSON must contain an exact match to the record type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        position - the position of the field.
        jsonInput - a JSON string
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not record-value or if the JSON doesn't match the record type of the field, according to the requirements set by the exact parameter.
        java.lang.IllegalArgumentException - if the jsonInput is malformed
        Since:
        4.2
      • putRecordAsJson

        RecordValue putRecordAsJson​(int position,
                                    java.io.InputStream jsonInput,
                                    boolean exact)
        Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a record-valued field, and the value assigned to it by this method is a new record created and populated form a given JSON stream. If the exact parameter is true, the input JSON must contain an exact match to the record type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        position - the position of the field.
        jsonInput - a JSON stream
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not record-value or if the JSON doesn't match the record type of the field, according to the requirements set by the exact parameter.
        java.lang.IllegalArgumentException - if the jsonInput is malformed
        Since:
        4.2
      • putArray

        ArrayValue putArray​(int position)
        Inserts the field at the given position, or updates its value if the field exists already. The specified field must be an array-valued field, and the value assigned to it by this method is an empty array that conforms to the array type declared for this field.
        Parameters:
        position - the position of the field.
        Returns:
        the empty array assigned to the field.
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not array-valued.
        Since:
        4.2
      • putArray

        RecordValue putArray​(int position,
                             java.lang.Iterable<?> list)
        Inserts a list of Java objects into the record as an array at the given position, or updates its value if the field exists already. The specified field must be an array-valued field, and the value assigned to it by this method is a new array that conforms to the array type declared for this field, and whose content is taken from the given java Iterable object.
        Parameters:
        position - the position of the field.
        list - the Iterable list of objects to insert.
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not record-valued or if the type of the list doesn't match the array type of the array field.
        Since:
        4.2
      • putArray

        RecordValue putArray​(int position,
                             java.lang.Object[] array)
        Inserts an array of Java objects into the record as an array at the given given position, or updates its value if the field exists already. The specified field must be an array-valued field, and the value assigned to it by this method is a new array that conforms to the array type declared for this field, and whose content is taken from the array of java objects.
        Parameters:
        position - the position of the field.
        array - the array of objects to insert.
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the field at position is not an array or the type of the objects in the array does not match the type of the array field.
        Since:
        4.2
      • putArrayAsJson

        RecordValue putArrayAsJson​(int position,
                                   java.lang.String jsonInput,
                                   boolean exact)
        Inserts the field at the given position, or updates its value if the field exists already. The specified field must be an array-valued field, and the value assigned to it by this method is a new array created and populated form a given JSON string. If the exact parameter is true, the input JSON must contain an exact match to the array type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        position - the position of the field.
        jsonInput - a JSON string
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not array-value or if the JSON doesn't match the array type of the field, according to the requirements set by the exact parameter.
        java.lang.IllegalArgumentException - if the jsonInput is malformed
        Since:
        4.2
      • putArrayAsJson

        RecordValue putArrayAsJson​(int position,
                                   java.io.InputStream jsonInput,
                                   boolean exact)
        Inserts the field at the given position, or updates its value if the field exists already. The specified field must be an array-valued field, and the value assigned to it by this method is a new array created and populated form a given JSON stream. If the exact parameter is true, the input JSON must contain an exact match to the array type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        position - the positionition of the field.
        jsonInput - a JSON stream
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not array-value or if the JSON doesn't match the array type of the field, according to the requirements set by the exact parameter.
        java.lang.IllegalArgumentException - if the jsonInput is malformed
        Since:
        4.2
      • putMap

        MapValue putMap​(int position)
        Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a map-valued field, and the value assigned to it by this method is an empty map that conforms to the array type declared for this field.
        Parameters:
        position - the position of the field.
        Returns:
        the empty map assigned to the field.
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not map-valued.
        Since:
        4.2
      • putMap

        RecordValue putMap​(int position,
                           java.util.Map<java.lang.String,​?> map)
        Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a map-valued field, and the value assigned to it by this method is a new map that conforms to the map type declared for this field, and whose content is taken from the given java map.
        Parameters:
        position - the position of the field.
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not map-valued or if the given map doesn't match the array type of the field.
        Since:
        4.2
      • putMapAsJson

        RecordValue putMapAsJson​(int position,
                                 java.lang.String jsonInput,
                                 boolean exact)
        Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a map-valued field, and the value assigned to it by this method is a new map created and populated form a given JSON string. If the exact parameter is true, the input JSON must contain an exact match to the map type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        position - the position of the field.
        jsonInput - a JSON string
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not map-value or if the JSON doesn't match the map type of the field, according to the requirements set by the exact parameter.
        java.lang.IllegalArgumentException - if the jsonInput is malformed
        Since:
        4.2
      • putMapAsJson

        RecordValue putMapAsJson​(int position,
                                 java.io.InputStream jsonInput,
                                 boolean exact)
        Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a map-valued field, and the value assigned to it by this method is a new map created and populated form a given JSON stream. If the exact parameter is true, the input JSON must contain an exact match to the map type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        position - the position of the field.
        jsonInput - a JSON stream
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the specified field is not map-value or if the JSON doesn't match the map type of the field, according to the requirements set by the exact parameter.
        java.lang.IllegalArgumentException - if the jsonInput is malformed
        Since:
        4.2
      • put

        RecordValue put​(java.lang.String fieldName,
                        int value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
      • put

        RecordValue put​(java.lang.String fieldName,
                        long value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
      • put

        RecordValue put​(java.lang.String fieldName,
                        java.lang.String value)
        Set the named field, silently overwriting existing values. This method is used to put a string into a field of type String. The String value is not parsed or interpreted. The methods putJson(java.lang.String, java.lang.String) and putEnum(int, java.lang.String) exist to put String values of those types.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
      • put

        RecordValue put​(java.lang.String fieldName,
                        double value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
      • put

        RecordValue put​(java.lang.String fieldName,
                        float value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
      • put

        RecordValue put​(java.lang.String fieldName,
                        boolean value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
      • putNumber

        RecordValue putNumber​(java.lang.String fieldName,
                              int value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
        Since:
        4.4
      • putNumber

        RecordValue putNumber​(java.lang.String fieldName,
                              long value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
        Since:
        4.4
      • putNumber

        RecordValue putNumber​(java.lang.String fieldName,
                              float value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
        Since:
        4.4
      • putNumber

        RecordValue putNumber​(java.lang.String fieldName,
                              double value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
        Since:
        4.4
      • putNumber

        RecordValue putNumber​(java.lang.String fieldName,
                              java.math.BigDecimal value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
        Since:
        4.4
      • put

        RecordValue put​(java.lang.String fieldName,
                        byte[] value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
      • putFixed

        RecordValue putFixed​(java.lang.String fieldName,
                             byte[] value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
      • putEnum

        RecordValue putEnum​(java.lang.String fieldName,
                            java.lang.String value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
      • put

        RecordValue put​(java.lang.String fieldName,
                        java.sql.Timestamp value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the date value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
        Since:
        4.3
      • putNull

        RecordValue putNull​(java.lang.String fieldName)
        Put a null value in the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
      • putJsonNull

        RecordValue putJsonNull​(java.lang.String fieldName)
        Puts a JSON NULL value in the named field, silently overwriting existing values. JSON NULL is a special value that returns true for FieldValue.isJsonNull(). The field must be of type JSON.
        Parameters:
        fieldName - name of the desired field
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field is not JSON.
        Since:
        4.3
      • put

        RecordValue put​(java.lang.String fieldName,
                        FieldValue value)
        Set the named field, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        value - the value to set
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the type of the field does not match the input type
      • putRecord

        RecordValue putRecord​(java.lang.String fieldName)
        Set a RecordValue field, silently overwriting existing values. The returned object is empty of fields and must be further set by the caller.
        Parameters:
        fieldName - name of the desired field
        Returns:
        an empty instance of RecordValue
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition.
      • putRecord

        RecordValue putRecord​(java.lang.String fieldName,
                              java.util.Map<java.lang.String,​?> map)
        Set a RecordValue field based on map input, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        map - to create value of the desired RecordValue field
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition
        java.lang.IllegalArgumentException - if the map value type doesn't match the field definition of the named field.
      • putRecordAsJson

        RecordValue putRecordAsJson​(java.lang.String fieldName,
                                    java.lang.String jsonInput,
                                    boolean exact)
        Set a RecordValue field, silently overwriting existing values. The created RecordValue is based on JSON string input. If the exact parameter is true, the input string must contain an exact match to the Record field definition, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        fieldName - name of the desired field. In this method the field must have a precise type and not be of type JSON.
        jsonInput - a JSON string
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition
        java.lang.IllegalArgumentException - if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correct
        java.lang.IllegalArgumentException - if the jsonInput is malformed
      • putRecordAsJson

        RecordValue putRecordAsJson​(java.lang.String fieldName,
                                    java.io.InputStream jsonInput,
                                    boolean exact)
        Set a RecordValue field, silently overwriting existing values. The created RecordValue is based on JSON stream input. If the exact parameter is true, the input string must contain an exact match to the Record field definition, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        fieldName - name of the desired field
        jsonInput - a JSON input stream
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition, or is of type JSON.
        java.lang.IllegalArgumentException - if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correct
        java.lang.IllegalArgumentException - if the jsonInput is malformed
      • putJson

        RecordValue putJson​(java.lang.String fieldName,
                            java.lang.String jsonInput)
        Set a RecordValue field of type JSON using the JSON input. The named field must be of type JSON.
        Parameters:
        fieldName - name of the desired field. The definition of this field must be of type JSON.
        jsonInput - a JSON string
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or its definition is not of type JSON.
        java.lang.IllegalArgumentException - if the JSON input is invalid or contains an unsupported construct.
        Since:
        4.2
      • putJson

        RecordValue putJson​(java.lang.String fieldName,
                            java.io.Reader jsonReader)
        Set a RecordValue field of type JSON using the JSON input. The named field must be of type JSON.
        Parameters:
        fieldName - name of the desired field. The definition of this field must be of type JSON.
        jsonReader - a Reader
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or its definition is not of type JSON.
        java.lang.IllegalArgumentException - if the JSON input is invalid or contains an unsupported construct.
        Since:
        4.2
      • putJson

        RecordValue putJson​(int position,
                            java.lang.String jsonInput)
        Set a RecordValue field of type JSON using the JSON input. The named field must be of type JSON.
        Parameters:
        position - the position of the field.
        jsonInput - a JSON string
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or its definition is not of type JSON.
        java.lang.IllegalArgumentException - if the JSON input is invalid or contains an unsupported construct.
        Since:
        4.2
      • putJson

        RecordValue putJson​(int position,
                            java.io.Reader jsonReader)
        Set a RecordValue field of type JSON using the JSON input. The named field must be of type JSON.
        Parameters:
        position - the position of the field.
        jsonReader - a Reader
        Returns:
        this
        Throws:
        java.lang.IndexOutOfBoundsException - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or its definition is not of type JSON.
        java.lang.IllegalArgumentException - if the JSON input is invalid or contains an unsupported construct.
        Since:
        4.2
      • putArray

        ArrayValue putArray​(java.lang.String fieldName)
        Set an ArrayValue field, silently overwriting existing values. The returned object is empty of fields and must be further set by the caller.
        Parameters:
        fieldName - name of the desired field
        Returns:
        an empty instance of ArrayValue
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition
      • putArray

        RecordValue putArray​(java.lang.String fieldName,
                             java.lang.Iterable<?> list)
        Set an ArrayValue field based on list input, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        list - to create value of the desired ArrayValue field
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition
        java.lang.IllegalArgumentException - if the list type doesn't match the field definition of the named field.
      • putArray

        RecordValue putArray​(java.lang.String fieldName,
                             java.lang.Object[] array)
        Set an ArrayValue field based on an array of Java Objects, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        array - to insert into the ArrayValue field
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field is not an array
        java.lang.IllegalArgumentException - if the type of the objects in the array does not match the type of the array field.
      • putArrayAsJson

        RecordValue putArrayAsJson​(java.lang.String fieldName,
                                   java.lang.String jsonInput,
                                   boolean exact)
        Set a ArrayValue field, silently overwriting existing values. The created ArrayValue is based on JSON string input. If the exact parameter is true, the input string must contain an exact match to all the nested Record definition in Array field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        fieldName - name of the desired field
        jsonInput - a JSON string
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition
        java.lang.IllegalArgumentException - if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correct
        java.lang.IllegalArgumentException - if the jsonInput is malformed
      • putArrayAsJson

        RecordValue putArrayAsJson​(java.lang.String fieldName,
                                   java.io.InputStream jsonInput,
                                   boolean exact)
        Set a ArrayValue field, silently overwriting existing values. The created ArrayValue is based on JSON stream input. If the exact parameter is true, the input string must contain an exact match to all the nested Record definition in Array field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        fieldName - name of the desired field
        jsonInput - a JSON stream input
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition
        java.lang.IllegalArgumentException - if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correct
        java.lang.IllegalArgumentException - if the jsonInput is malformed
      • putMap

        MapValue putMap​(java.lang.String fieldName)
        Set a MapValue field, silently overwriting existing values. The returned object is empty of fields and must be further set by the caller.
        Parameters:
        fieldName - name of the desired field
        Returns:
        an empty instance of MapValue
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition
      • putMap

        RecordValue putMap​(java.lang.String fieldName,
                           java.util.Map<java.lang.String,​?> map)
        Set a MapValue field based on map input, silently overwriting existing values.
        Parameters:
        fieldName - name of the desired field
        map - to create value of the desired MapValue field
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition
        java.lang.IllegalArgumentException - if the map value type doesn't match the field definition of the named field.
      • putMapAsJson

        RecordValue putMapAsJson​(java.lang.String fieldName,
                                 java.lang.String jsonInput,
                                 boolean exact)
        Set a MapValue field, silently overwriting existing values. The created MapValue is based on JSON string input. If the exact parameter is true, the input string must contain an exact match to all the nested Record definition in Map field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        fieldName - name of the desired field
        jsonInput - a JSON string
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition
        java.lang.IllegalArgumentException - if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correct
        java.lang.IllegalArgumentException - if the jsonInput is malformed
      • putMapAsJson

        RecordValue putMapAsJson​(java.lang.String fieldName,
                                 java.io.InputStream jsonInput,
                                 boolean exact)
        Set a MapValue field, silently overwriting existing values. The created MapValue is based on JSON stream input. If the exact parameter is true, the input string must contain an exact match to all the nested Record definition in Map field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.
        Parameters:
        fieldName - name of the desired field
        jsonInput - a JSON stream input
        exact - set to true for an exact match. See above
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition
        java.lang.IllegalArgumentException - if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correct
        java.lang.IllegalArgumentException - if the jsonInput is malformed