Record Class WanMerkleTree.WanMerkleDiff

java.lang.Object
java.lang.Record
com.loomcache.server.wan.WanMerkleTree.WanMerkleDiff
Enclosing class:
WanMerkleTree

public static record WanMerkleTree.WanMerkleDiff(@NonNull String localRootHash, @NonNull String remoteRootHash, @NonNull List<Integer> differingBuckets, @NonNull List<WanMerkleTree.WanKey> keysToUpsert, @NonNull List<WanMerkleTree.WanKey> keysToDelete) extends Record
  • Constructor Details

    • WanMerkleDiff

      public WanMerkleDiff(@NonNull String localRootHash, @NonNull String remoteRootHash, @NonNull List<Integer> differingBuckets, @NonNull List<WanMerkleTree.WanKey> keysToUpsert, @NonNull List<WanMerkleTree.WanKey> keysToDelete)
      Creates an instance of a WanMerkleDiff record class.
      Parameters:
      localRootHash - the value for the localRootHash record component
      remoteRootHash - the value for the remoteRootHash record component
      differingBuckets - the value for the differingBuckets record component
      keysToUpsert - the value for the keysToUpsert record component
      keysToDelete - the value for the keysToDelete record component
  • Method Details

    • isEmpty

      public boolean isEmpty()
    • 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.
    • localRootHash

      public @NonNull String localRootHash()
      Returns the value of the localRootHash record component.
      Returns:
      the value of the localRootHash record component
    • remoteRootHash

      public @NonNull String remoteRootHash()
      Returns the value of the remoteRootHash record component.
      Returns:
      the value of the remoteRootHash record component
    • differingBuckets

      public @NonNull List<Integer> differingBuckets()
      Returns the value of the differingBuckets record component.
      Returns:
      the value of the differingBuckets record component
    • keysToUpsert

      public @NonNull List<WanMerkleTree.WanKey> keysToUpsert()
      Returns the value of the keysToUpsert record component.
      Returns:
      the value of the keysToUpsert record component
    • keysToDelete

      public @NonNull List<WanMerkleTree.WanKey> keysToDelete()
      Returns the value of the keysToDelete record component.
      Returns:
      the value of the keysToDelete record component