Interface KastRowBuilder
-
public interface KastRowBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description KastRowcreateKastRow(int arity)Creates a fixed-length row in position-based field mode.KastRowcreateKastRow(KastRowKind kind, int arity)Creates a fixed-length row in position-based field mode.KastRowcreateKastRowOf(Object... values)Creates a fixed-length row in position-based field mode and assigns the given values to the row's fields.KastRowcreateKastRowOfKind(KastRowKind kind, Object... values)Creates a fixed-length row in position-based field mode with given kind and assigns the given values to the row's fields.KastRowcreateKastRowWithNames()Creates a variable-length row in name-based field mode.KastRowcreateKastRowWithNames(KastRowKind kind)Creates a variable-length row in name-based field mode.KastRowcreateKastRowWithPositions(int arity)Creates a fixed-length row in position-based field mode.KastRowcreateKastRowWithPositions(KastRowKind kind, int arity)Creates a fixed-length row in position-based field mode.KastRowkastRowCopy(KastRow kastRow)Creates a new row which is copied from another row (including itsKastRowKind).KastRowkastRowJoin(KastRow first, KastRow... remainings)Creates a new row with fields that are copied from the other rows and appended to the resulting row in the given order.KastRowkastRowProject(KastRow kastRow, int[] fieldPositions)Creates a new row with projected fields and identicalKastRowKindfrom another row.KastRowkastRowProject(KastRow row, String[] fieldNames)Creates a new row with projected fields and identicalKastRowKindfrom another row.
-
-
-
Method Detail
-
createKastRow
KastRow createKastRow(KastRowKind kind, int arity)
Creates a fixed-length row in position-based field mode.The semantics are equivalent to
createKastRowWithPositions(KastRowKind, int). This constructor exists for backwards compatibility.- Parameters:
kind- kind of change a row describes in a changelogarity- the number of fields in the row
-
createKastRow
KastRow createKastRow(int arity)
Creates a fixed-length row in position-based field mode.The semantics are equivalent to
createKastRowWithPositions(int). This constructor exists for backwards compatibility.- Parameters:
arity- the number of fields in the row
-
createKastRowWithPositions
KastRow createKastRowWithPositions(KastRowKind kind, int arity)
Creates a fixed-length row in position-based field mode.Fields can be accessed by position via
KastRow.setField(int, Object)andKastRow.getField(int).See the class documentation of
KastRowfor more information.- Parameters:
kind- kind of change a row describes in a changelogarity- the number of fields in the row- Returns:
- a new row instance
-
createKastRowWithPositions
KastRow createKastRowWithPositions(int arity)
Creates a fixed-length row in position-based field mode.Fields can be accessed by position via
KastRow.setField(int, Object)andKastRow.getField(int).By default, a row describes an
KastRowKind.INSERTchange.See the class documentation of
KastRowfor more information.- Parameters:
arity- the number of fields in the row- Returns:
- a new row instance
-
createKastRowWithNames
KastRow createKastRowWithNames(KastRowKind kind)
Creates a variable-length row in name-based field mode.Fields can be accessed by name via
KastRow.setField(String, Object)andKastRow.getField(String).See the class documentation of
KastRowKindfor more information.- Parameters:
kind- kind of change a row describes in a changelog- Returns:
- a new row instance
-
createKastRowWithNames
KastRow createKastRowWithNames()
Creates a variable-length row in name-based field mode.Fields can be accessed by name via
KastRow.setField(String, Object)andKastRow.getField(String).By default, a row describes an
KastRowKind.INSERTchange.See the class documentation of
KastRowfor more information.- Returns:
- a new row instance
-
createKastRowOf
KastRow createKastRowOf(Object... values)
Creates a fixed-length row in position-based field mode and assigns the given values to the row's fields.This method should be more convenient than
createKastRowWithPositions(int)(int)} in many cases.For example:
kastRowBuilder.createKastRowOf("hello", true, 1L);instead ofKastRow row = kastRowBuilder.createKastRowWithPositions(3); row.setField(0, "hello"); row.setField(1, true); row.setField(2, 1L);By default, a row describes an
KastRowKind.INSERTchange.
-
createKastRowOfKind
KastRow createKastRowOfKind(KastRowKind kind, Object... values)
Creates a fixed-length row in position-based field mode with given kind and assigns the given values to the row's fields.This method should be more convenient than
createKastRowWithPositions(KastRowKind, int)(RowKind, int)} in many cases.For example:
kastRowBuilder.createKastRowOfKind(RowKind.INSERT, "hello", true, 1L);instead ofKastRow row = kastRowBuilder.createKastRowWithPositions(3); row.setField(0, "hello"); row.setField(1, true); row.setField(2, 1L);
-
kastRowCopy
KastRow kastRowCopy(KastRow kastRow)
Creates a new row which is copied from another row (including itsKastRowKind).This method does not perform a deep copy.
-
kastRowProject
KastRow kastRowProject(KastRow kastRow, int[] fieldPositions)
Creates a new row with projected fields and identicalKastRowKindfrom another row.This method does not perform a deep copy.
Note: The row must operate in position-based field mode. Field names are not projected.
- Parameters:
fieldPositions- field indices to be projected
-
kastRowProject
KastRow kastRowProject(KastRow row, String[] fieldNames)
Creates a new row with projected fields and identicalKastRowKindfrom another row.This method does not perform a deep copy.
Note: The row must operate in name-based field mode.
- Parameters:
fieldNames- field names to be projected
-
kastRowJoin
KastRow kastRowJoin(KastRow first, KastRow... remainings)
Creates a new row with fields that are copied from the other rows and appended to the resulting row in the given order. TheKastRowKindof the first row determines theKastRowKindof the result.This method does not perform a deep copy.
Note: All rows must operate in position-based field mode.
-
-