Record Class DbForeignKey<K extends DbKey>

java.lang.Object
java.lang.Record
io.camunda.zeebe.db.impl.DbForeignKey<K>
Type Parameters:
K -
Record Components:
inner -
columnFamily -
All Implemented Interfaces:
ContainsForeignKeys, DbKey, DbValue, BufferReader, BufferWriter

public record DbForeignKey<K extends DbKey>(K extends DbKey inner, Enum<?> columnFamily, DbForeignKey.MatchType match, Predicate<K extends DbKey> skip) extends Record implements DbKey, DbValue, ContainsForeignKeys
Wraps a key from a given column family. When serialized via BufferWriter, this behaves exactly as the inner key.
  • Constructor Details

    • DbForeignKey

      public DbForeignKey(K inner, Enum<?> columnFamily)
    • DbForeignKey

      public DbForeignKey(K inner, Enum<?> columnFamily, DbForeignKey.MatchType match)
    • DbForeignKey

      public DbForeignKey(K inner, Enum<?> columnFamily, DbForeignKey.MatchType match, Predicate<K> skip)
      Creates an instance of a DbForeignKey record class.
      Parameters:
      inner - the value for the inner record component
      columnFamily - the value for the columnFamily record component
      match - the value for the match record component
      skip - the value for the skip record component
  • Method Details

    • wrap

      public void wrap(org.agrona.DirectBuffer buffer, int offset, int length)
      Specified by:
      wrap in interface BufferReader
    • getLength

      public int getLength()
      Specified by:
      getLength in interface BufferWriter
    • write

      public void write(org.agrona.MutableDirectBuffer buffer, int offset)
      Specified by:
      write in interface BufferWriter
    • containedForeignKeys

      public Collection<DbForeignKey<DbKey>> containedForeignKeys()
      Specified by:
      containedForeignKeys in interface ContainsForeignKeys
    • shouldSkipCheck

      public boolean shouldSkipCheck()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • inner

      public K inner()
      Returns the value of the inner record component.
      Returns:
      the value of the inner record component
    • columnFamily

      public Enum<?> columnFamily()
      Returns the value of the columnFamily record component.
      Returns:
      the value of the columnFamily record component
    • match

      public DbForeignKey.MatchType match()
      Returns the value of the match record component.
      Returns:
      the value of the match record component
    • skip

      public Predicate<K> skip()
      Returns the value of the skip record component.
      Returns:
      the value of the skip record component