Class SimpleBuilders.RowBuilder

java.lang.Object
org.apache.cassandra.db.SimpleBuilders.RowBuilder
All Implemented Interfaces:
Row.SimpleBuilder
Enclosing class:
SimpleBuilders

public static class SimpleBuilders.RowBuilder extends Object implements Row.SimpleBuilder
  • Field Details

    • timestamp

      protected long timestamp
    • ttl

      protected int ttl
    • nowInSec

      protected long nowInSec
  • Constructor Details

  • Method Details

    • add

      public Row.SimpleBuilder add(String columnName, Object value)
      Description copied from interface: Row.SimpleBuilder
      Adds a value to a given column.
      Specified by:
      add in interface Row.SimpleBuilder
      Parameters:
      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).
      Returns:
      this builder.
    • appendAll

      public Row.SimpleBuilder appendAll(String columnName, Object value)
      Description copied from interface: Row.SimpleBuilder
      Appends new values to a given non-frozen collection column.

      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().

      Specified by:
      appendAll in interface Row.SimpleBuilder
      Parameters:
      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).
      Returns:
      this builder.
    • delete

      public Row.SimpleBuilder delete()
      Description copied from interface: Row.SimpleBuilder
      Deletes the whole row.

      If called, this is generally the only method called on the builder (outside of timestamp().

      Specified by:
      delete in interface Row.SimpleBuilder
      Returns:
      this builder.
    • deletePrevious

      public Row.SimpleBuilder deletePrevious()
      Description copied from interface: Row.SimpleBuilder
      Deletes the whole row with a timestamp that is just before the new data's timestamp, to make sure no expired data remains on the row.
      Specified by:
      deletePrevious in interface Row.SimpleBuilder
      Returns:
      this builder.
    • delete

      public Row.SimpleBuilder delete(String columnName)
      Description copied from interface: Row.SimpleBuilder
      Removes the value for a given column (creating a tombstone).
      Specified by:
      delete in interface Row.SimpleBuilder
      Parameters:
      columnName - the name of the column to delete.
      Returns:
      this builder.
    • noPrimaryKeyLivenessInfo

      public Row.SimpleBuilder noPrimaryKeyLivenessInfo()
      Description copied from interface: Row.SimpleBuilder
      Don't include any primary key LivenessInfo in the built row.
      Specified by:
      noPrimaryKeyLivenessInfo in interface Row.SimpleBuilder
      Returns:
      this builder.
    • build

      public Row build()
      Description copied from interface: Row.SimpleBuilder
      Returns the built row.
      Specified by:
      build in interface Row.SimpleBuilder
      Returns:
      the built row.
    • copyParams

      protected void copyParams(org.apache.cassandra.db.SimpleBuilders.AbstractBuilder<?> other)
    • timestamp

      public Row.SimpleBuilder timestamp(long timestamp)
    • ttl

      public Row.SimpleBuilder ttl(int ttl)
    • nowInSec

      public Row.SimpleBuilder nowInSec(long nowInSec)