Interface KastRowBuilder


  • public interface KastRowBuilder
    • 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 changelog
        arity - 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) and KastRow.getField(int).

        See the class documentation of KastRow for more information.

        Parameters:
        kind - kind of change a row describes in a changelog
        arity - 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) and KastRow.getField(int).

        By default, a row describes an KastRowKind.INSERT change.

        See the class documentation of KastRow for more information.

        Parameters:
        arity - the number of fields in the row
        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 of
             KastRow row = kastRowBuilder.createKastRowWithPositions(3);
             row.setField(0, "hello");
             row.setField(1, true);
             row.setField(2, 1L);
         

        By default, a row describes an KastRowKind.INSERT change.

      • 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 of
             KastRow 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 its KastRowKind).

        This method does not perform a deep copy.

      • kastRowProject

        KastRow kastRowProject​(KastRow kastRow,
                               int[] fieldPositions)
        Creates a new row with projected fields and identical KastRowKind from 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 identical KastRowKind from 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. The KastRowKind of the first row determines the KastRowKind of the result.

        This method does not perform a deep copy.

        Note: All rows must operate in position-based field mode.