public static interface Record.Builder
If null
is supplied for any field, a zero length string ("") is
written to the record.
Such a builder may be created using Record.Factory.newRecordBuilder()
.
Modifier and Type | Method and Description |
---|---|
Record.Builder |
add(Collection<?> fields)
Adds one or more fields to the end of the record.
|
Record.Builder |
add(int index,
String field)
Inserts a field at a specified index within the record, moving
subsequent fields along the record.
|
Record.Builder |
add(String... fields)
Adds one or more fields to the end of the record.
|
Record |
build()
Builds the record.
|
Record.Builder |
remove(int index)
Removes a specified field from the record.
|
Record.Builder |
reset()
Resets the builder to its initial state.
|
Record.Builder |
set(int index,
String field)
Replaces a field at a specified index within the record.
|
Record.Builder add(String... fields)
fields
- a list of fields to addRecord.Builder add(Collection<?> fields)
A collection of any type may be supplied and the toString()
value of each object will used as the String value.
fields
- the collection of field objects to add. If this is
supplied as null, nothing is addedRecord.Builder add(int index, String field) throws IndexOutOfBoundsException
index
- the index to add a field atfield
- the field value to addIndexOutOfBoundsException
- if index
is out of boundsRecord.Builder remove(int index) throws IndexOutOfBoundsException
index
- the index of the field to removeIndexOutOfBoundsException
- if index
is out of boundsRecord.Builder set(int index, String field) throws IndexOutOfBoundsException
index
- the index of the field to replacefield
- the new field valueIndexOutOfBoundsException
- if index
is out of boundsRecord.Builder reset()
Record build()
Record
Copyright © 2016 Push Technology Ltd. All Rights Reserved.