Record Class SimpleCell<R,C,V>

java.lang.Object
java.lang.Record
net.luis.utils.collection.util.SimpleCell<R,C,V>
Type Parameters:
R - The type of the row key
C - The type of the column key
V - The type of the value
Record Components:
getRowKey - The row key of the cell
getColumnKey - The column key of the cell
getValue - The value of the cell
All Implemented Interfaces:
com.google.common.collect.Table.Cell<R,C,V>

public record SimpleCell<R,C,V>(R getRowKey, C getColumnKey, V getValue) extends Record implements com.google.common.collect.Table.Cell<R,C,V>
A simple implementation of the Table.Cell interface.
  • Field Details

    • getRowKey

      @NotNull private final R getRowKey
      The field for the getRowKey record component.
    • getColumnKey

      @NotNull private final C getColumnKey
      The field for the getColumnKey record component.
    • getValue

      @Nullable private final V getValue
      The field for the getValue record component.
  • Constructor Details

    • SimpleCell

      public SimpleCell(@NotNull R getRowKey, @NotNull C getColumnKey, @Nullable V getValue)
      Constructs a new simple cell with the specified row key, column key and value.
      Parameters:
      getRowKey - The row key of the cell
      getColumnKey - The column key of the cell
      getValue - The value of the cell
      Throws:
      NullPointerException - if the row key or column key is null
  • Method Details

    • equals

      public 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 interface com.google.common.collect.Table.Cell<R,C,V>
      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.
    • hashCode

      public 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 interface com.google.common.collect.Table.Cell<R,C,V>
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • toString

      @NotNull public @NotNull 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
    • getRowKey

      @NotNull public R getRowKey()
      Returns the value of the getRowKey record component.
      Specified by:
      getRowKey in interface com.google.common.collect.Table.Cell<R,C,V>
      Returns:
      the value of the getRowKey record component
    • getColumnKey

      @NotNull public C getColumnKey()
      Returns the value of the getColumnKey record component.
      Specified by:
      getColumnKey in interface com.google.common.collect.Table.Cell<R,C,V>
      Returns:
      the value of the getColumnKey record component
    • getValue

      @Nullable public V getValue()
      Returns the value of the getValue record component.
      Specified by:
      getValue in interface com.google.common.collect.Table.Cell<R,C,V>
      Returns:
      the value of the getValue record component