public static class SimpleBuilders.RowBuilder extends java.lang.Object implements Row.SimpleBuilder
Constructor and Description |
---|
RowBuilder(TableMetadata metadata,
java.lang.Object... clusteringColumns) |
Modifier and Type | Method and Description |
---|---|
Row.SimpleBuilder |
add(java.lang.String columnName,
java.lang.Object value)
Adds a value to a given column.
|
Row.SimpleBuilder |
appendAll(java.lang.String columnName,
java.lang.Object value)
Appends new values to a given non-frozen collection column.
|
Row |
build()
Returns the built row.
|
Row.SimpleBuilder |
delete()
Deletes the whole row.
|
Row.SimpleBuilder |
delete(java.lang.String columnName)
Removes the value for a given column (creating a tombstone).
|
Row.SimpleBuilder |
noPrimaryKeyLivenessInfo()
Don't include any primary key
LivenessInfo in the built row. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
timestamp, ttl
public RowBuilder(TableMetadata metadata, java.lang.Object... clusteringColumns)
public Row.SimpleBuilder add(java.lang.String columnName, java.lang.Object value)
Row.SimpleBuilder
add
in interface Row.SimpleBuilder
columnName
- the name of the column for which to add a new value.value
- the value to add, which must be of the proper type for columnName
. This can be null
in which case the this is equivalent to delete(columnName)
.public Row.SimpleBuilder appendAll(java.lang.String columnName, java.lang.Object value)
Row.SimpleBuilder
This method is similar to add()
but the collection elements added through this method are "appended"
to any pre-exising elements. In other words, this is like add()
except that it doesn't delete the
previous value of the collection. This can only be called on non-frozen collection columns.
Note that this method can be used in replacement of add()
if you know that there can't be any
pre-existing value for that column, in which case this is slightly less expensive as it avoid the collection
tombstone inherent to add()
.
appendAll
in interface Row.SimpleBuilder
columnName
- the name of the column for which to add a new value, which must be a non-frozen collection.value
- the value to add, which must be of the proper type for columnName
(in other words, it
must be a collection).public Row.SimpleBuilder delete()
Row.SimpleBuilder
If called, this is generally the only method called on the builder (outside of timestamp()
.
delete
in interface Row.SimpleBuilder
public Row.SimpleBuilder delete(java.lang.String columnName)
Row.SimpleBuilder
delete
in interface Row.SimpleBuilder
columnName
- the name of the column to delete.public Row.SimpleBuilder noPrimaryKeyLivenessInfo()
Row.SimpleBuilder
LivenessInfo
in the built row.noPrimaryKeyLivenessInfo
in interface Row.SimpleBuilder
public Row build()
Row.SimpleBuilder
build
in interface Row.SimpleBuilder
Copyright © 2009- The Apache Software Foundation