@API.Public @API.NotThreadSafe public interface DocumentBuilder
Modifier and Type | Method and Description |
---|---|
DocumentBuilder |
add(BigDecimal value)
Adds a
BigDecimal value at the current index in the current array
and advances the current index by 1. |
DocumentBuilder |
add(boolean value)
Adds a
boolean value at the current index in the current array and
advances the current index by 1. |
DocumentBuilder |
add(byte value)
Adds a
byte value at the current index in the current array and
advances the current index by 1. |
DocumentBuilder |
add(byte[] value)
Appends the byte array as a
BINARY value to the current array. |
DocumentBuilder |
add(byte[] value,
int offset,
int length)
Appends the byte array bounded by offset and length as a
BINARY
value to the current array. |
DocumentBuilder |
add(ByteBuffer value)
Appends the
ByteBuffer as a BINARY value to the current array. |
DocumentBuilder |
add(Document value)
Appends the
Document to the current array. |
DocumentBuilder |
add(double value)
Adds a
double value at the current index in the current array and
advances the current index by 1. |
DocumentBuilder |
add(float value)
Adds a
float value at the current index in the current array and
advances the current index by 1. |
DocumentBuilder |
add(int value)
Adds an
int value at the current index in the current array and
advances the current index by 1. |
DocumentBuilder |
add(long value)
Adds a
long value at the current index in the current array and
advances the current index by 1. |
DocumentBuilder |
add(ODate value) |
DocumentBuilder |
add(OInterval value) |
DocumentBuilder |
add(OTime value) |
DocumentBuilder |
add(OTimestamp value) |
DocumentBuilder |
add(short value)
Adds a
short value at the current index in the current array and
advances the current index by 1. |
DocumentBuilder |
add(String value)
Adds a
String value at the current index in the current array and
advances the current index by 1. |
DocumentBuilder |
add(Value value)
Appends the
Value to the current array. |
DocumentBuilder |
addDate(int days)
Appends the specified
date value represented as the number of
days since epoch to the current array. |
DocumentBuilder |
addDecimal(byte[] unscaledValue,
int scale)
Adds a byte array containing the two's complement binary representation
and an
int scale as a DECIMAL value at the current index
in the current array and advances the current index by 1. |
DocumentBuilder |
addDecimal(double decimalValue)
Adds a double number as a
DECIMAL value at the current index in the
current array and advances the current index by 1. |
DocumentBuilder |
addDecimal(int unscaledValue,
int scale)
Adds an
int unscaled value and an int scale as a
DECIMAL value at the current index in the current array
and advances the current index by 1. |
DocumentBuilder |
addDecimal(long decimalValue)
Adds a long number as a
DECIMAL value at the current index in the
current array and advances the current index by 1. |
DocumentBuilder |
addDecimal(long unscaledValue,
int scale)
Adds an
long unscaled value and an int scale as a
DECIMAL value at the current index in the current array
and advances the current index by 1. |
DocumentBuilder |
addInterval(long durationInMs) |
DocumentBuilder |
addNewArray() |
DocumentBuilder |
addNewMap() |
DocumentBuilder |
addNull()
Appends a
NULL value to the current array. |
DocumentBuilder |
addTime(int millis)
Appends the specified
time value represented as number of
milliseconds since midnight to the current array. |
DocumentBuilder |
addTimestamp(long timeMillis) |
DocumentBuilder |
endArray() |
DocumentBuilder |
endMap() |
Document |
getDocument() |
DocumentBuilder |
put(String field,
BigDecimal value) |
DocumentBuilder |
put(String field,
boolean value)
Associates the specified
boolean value with the specified
field in the current map. |
DocumentBuilder |
put(String field,
byte value) |
DocumentBuilder |
put(String field,
byte[] value) |
DocumentBuilder |
put(String field,
byte[] value,
int offset,
int length) |
DocumentBuilder |
put(String field,
ByteBuffer value) |
DocumentBuilder |
put(String field,
Document value) |
DocumentBuilder |
put(String field,
double value) |
DocumentBuilder |
put(String field,
float value) |
DocumentBuilder |
put(String field,
int value) |
DocumentBuilder |
put(String field,
long value) |
DocumentBuilder |
put(String field,
Map<String,Object> value) |
DocumentBuilder |
put(String field,
ODate value) |
DocumentBuilder |
put(String field,
OInterval value) |
DocumentBuilder |
put(String field,
OTime value) |
DocumentBuilder |
put(String field,
OTimestamp value) |
DocumentBuilder |
put(String field,
short value) |
DocumentBuilder |
put(String field,
String value)
Associates the specified
String value with the specified
field in the current map. |
DocumentBuilder |
put(String field,
Value value) |
DocumentBuilder |
putDate(String field,
int days)
Associates the specified
date value represented as the number
of days since epoch with the specified field in the
current map. |
DocumentBuilder |
putDecimal(String field,
byte[] unscaledValue,
int scale) |
DocumentBuilder |
putDecimal(String field,
double decimalValue) |
DocumentBuilder |
putDecimal(String field,
int unscaledValue,
int scale) |
DocumentBuilder |
putDecimal(String field,
long decimalValue) |
DocumentBuilder |
putDecimal(String field,
long unscaledValue,
int scale) |
DocumentBuilder |
putInterval(String field,
int months,
int days,
int milliseconds) |
DocumentBuilder |
putInterval(String field,
long durationInMs) |
DocumentBuilder |
putNewArray(String field) |
DocumentBuilder |
putNewMap(String field) |
DocumentBuilder |
putNull(String field) |
DocumentBuilder |
putTime(String field,
int millis)
Associates the specified
time value represented as number of
milliseconds since midnight with the specified field in the
current map. |
DocumentBuilder |
putTimestamp(String field,
long timeMillis)
Associates the specified
timestamp value represented as the number
of milliseconds since epoch with the specified field in the
current map. |
DocumentBuilder |
setArrayIndex(int index)
Sets the index in the current array at which the next value will be added.
|
DocumentBuilder put(@API.NonNullable String field, boolean value)
boolean
value with the specified
field
in the current map. Any previous association will be
overwritten.field
- the name of the fieldvalue
- the boolean
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in a MAP segmentDocumentBuilder put(@API.NonNullable String field, @API.NonNullable String value)
String
value with the specified
field
in the current map. Any previous association will be
overwritten.field
- the name of the fieldvalue
- the String
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in a MAP segmentDocumentBuilder put(@API.NonNullable String field, byte value)
DocumentBuilder put(@API.NonNullable String field, short value)
DocumentBuilder put(@API.NonNullable String field, int value)
DocumentBuilder put(@API.NonNullable String field, long value)
DocumentBuilder put(@API.NonNullable String field, float value)
DocumentBuilder put(@API.NonNullable String field, double value)
DocumentBuilder put(@API.NonNullable String field, @API.NonNullable BigDecimal value)
DocumentBuilder putDecimal(@API.NonNullable String field, long decimalValue)
DocumentBuilder putDecimal(@API.NonNullable String field, double decimalValue)
DocumentBuilder putDecimal(@API.NonNullable String field, int unscaledValue, int scale)
DocumentBuilder putDecimal(@API.NonNullable String field, long unscaledValue, int scale)
DocumentBuilder putDecimal(@API.NonNullable String field, @API.NonNullable byte[] unscaledValue, int scale)
DocumentBuilder put(@API.NonNullable String field, @API.NonNullable byte[] value)
DocumentBuilder put(@API.NonNullable String field, @API.NonNullable byte[] value, int offset, int length)
DocumentBuilder put(@API.NonNullable String field, @API.NonNullable ByteBuffer value)
DocumentBuilder put(@API.NonNullable String field, @API.NonNullable ODate value)
DocumentBuilder putDate(@API.NonNullable String field, int days)
date
value represented as the number
of days since epoch with the specified field
in the
current map. Any previous association will be overwritten.field
- the name of the fielddays
- the date
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in a MAP segmentDocumentBuilder put(@API.NonNullable String field, @API.NonNullable OTime value)
DocumentBuilder putTime(@API.NonNullable String field, int millis)
time
value represented as number of
milliseconds since midnight with the specified field
in the
current map. Any previous association will be overwritten.field
- the name of the fieldmillis
- the time
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in a MAP segmentIllegalArgumentException
- if the value of millis
is greater
than 86400000DocumentBuilder put(@API.NonNullable String field, @API.NonNullable OTimestamp value)
DocumentBuilder putTimestamp(@API.NonNullable String field, long timeMillis)
timestamp
value represented as the number
of milliseconds since epoch with the specified field
in the
current map. Any previous association will be overwritten.field
- the name of the fieldtimeMillis
- the timestamp
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in a MAP segmentDocumentBuilder put(@API.NonNullable String field, @API.NonNullable OInterval value)
DocumentBuilder putInterval(@API.NonNullable String field, long durationInMs)
DocumentBuilder putInterval(@API.NonNullable String field, int months, int days, int milliseconds)
DocumentBuilder putNewMap(@API.NonNullable String field)
DocumentBuilder putNewArray(@API.NonNullable String field)
DocumentBuilder putNull(@API.NonNullable String field)
DocumentBuilder put(@API.NonNullable String field, @API.NonNullable Value value)
DocumentBuilder put(@API.NonNullable String field, @API.NonNullable Document value)
DocumentBuilder put(@API.NonNullable String field, @API.NonNullable Map<String,Object> value)
DocumentBuilder setArrayIndex(int index)
index
- the index at which the next value will be addedthis
for chained invocationIllegalArgumentException
- if the index is not larger than the last
written index.IllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(boolean value)
boolean
value at the current index in the current array and
advances the current index by 1.value
- the boolean
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(@API.NonNullable String value)
String
value at the current index in the current array and
advances the current index by 1.value
- the String
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(byte value)
byte
value at the current index in the current array and
advances the current index by 1.value
- the byte
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(short value)
short
value at the current index in the current array and
advances the current index by 1.value
- the short
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(int value)
int
value at the current index in the current array and
advances the current index by 1.value
- the int
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segment.DocumentBuilder add(long value)
long
value at the current index in the current array and
advances the current index by 1.value
- the long
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(float value)
float
value at the current index in the current array and
advances the current index by 1.value
- the float
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(double value)
double
value at the current index in the current array and
advances the current index by 1.value
- the double
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(@API.NonNullable BigDecimal value)
BigDecimal
value at the current index in the current array
and advances the current index by 1.value
- the BigDecimal
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder addDecimal(long decimalValue)
DECIMAL
value at the current index in the
current array and advances the current index by 1.decimalValue
- the long
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder addDecimal(double decimalValue)
DECIMAL
value at the current index in the
current array and advances the current index by 1.decimalValue
- the double
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder addDecimal(int unscaledValue, int scale)
int
unscaled value and an int
scale as a
DECIMAL
value at the current index in the current array
and advances the current index by 1. The DECIMAL
value is
(unscaledValue × 10-scale).unscaledValue
- unscaled value of the DECIMAL
scale
- scale of the DECIMAL
this
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder addDecimal(long unscaledValue, int scale)
long
unscaled value and an int
scale as a
DECIMAL
value at the current index in the current array
and advances the current index by 1. The DECIMAL
value is
(unscaledValue × 10-scale).unscaledValue
- unscaled value of the DECIMAL
scale
- scale of the DECIMAL
this
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder addDecimal(@API.NonNullable byte[] unscaledValue, int scale)
int
scale as a DECIMAL
value at the current index
in the current array and advances the current index by 1. The input array
is assumed to be in big-endian byte-order: the most significant
byte is in the zeroth element.unscaledValue
- unscaled value of the DECIMAL
scale
- scale of the DECIMAL
this
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(@API.NonNullable byte[] value)
BINARY
value to the current array.value
- the byte array to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(@API.NonNullable byte[] value, int offset, int length)
BINARY
value to the current array.value
- the byte array to appendoffset
- the start offset in the byte arraylength
- the length from the offsetthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentIndexOutOfBoundsException
- if the offset or offset+length are outside
of byte array rangeDocumentBuilder add(@API.NonNullable ByteBuffer value)
ByteBuffer
as a BINARY
value to the current array.value
- the ByteBuffer
to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder addNull()
NULL
value to the current array.this
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(@API.NonNullable Value value)
Value
to the current array.value
- the Value
to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder add(@API.NonNullable Document value)
Document
to the current array.value
- the Document
to appendthis
for chained invocationIllegalStateException
- if the builder is not in an ARRAY segmentDocumentBuilder addNewArray()
DocumentBuilder addNewMap()
DocumentBuilder add(@API.NonNullable OTime value)
DocumentBuilder addTime(int millis)
time
value represented as number of
milliseconds since midnight to the current array.millis
- the time
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in a ARRAY segmentIllegalArgumentException
- if the value of millis
is greater
than 86400000DocumentBuilder add(@API.NonNullable ODate value)
DocumentBuilder addDate(int days)
date
value represented as the number of
days since epoch to the current array.days
- the date
value to appendthis
for chained invocationIllegalStateException
- if the builder is not in a ARRAY segmentDocumentBuilder add(@API.NonNullable OTimestamp value)
DocumentBuilder addTimestamp(long timeMillis)
DocumentBuilder add(@API.NonNullable OInterval value)
DocumentBuilder addInterval(long durationInMs)
DocumentBuilder endArray()
DocumentBuilder endMap()
Document getDocument()
Copyright © 2015–2019 MapR Technologies, Inc.. All rights reserved.