Package org.sosy_lab.common.collect
Record Class MapsDifference.Entry<K,V>
java.lang.Object
java.lang.Record
org.sosy_lab.common.collect.MapsDifference.Entry<K,V>
- Type Parameters:
K- The type of the key.V- The type of the values.
- Enclosing class:
- MapsDifference
@Immutable(containerOf={"K","V"})
public static record MapsDifference.Entry<K,V> (K key, Optional<V> leftValue, Optional<V> rightValue)
extends Record
Class representing the difference between two maps for a given key. This class only allows
non-null keys and values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static <K,V> MapsDifference.Entry<K, V> forDifferingValues(K pKey, V pLeftValue, V pRightValue) static <K,V> MapsDifference.Entry<K, V> forLeftValueOnly(K pKey, V pLeftValue) static <K,V> MapsDifference.Entry<K, V> forRightValueOnly(K pKey, V pRightValue) getKey()Deprecated.Deprecated.Deprecated.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.Returns the value of theleftValuerecord component.Returns the value of therightValuerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Entry
Creates an instance of aEntryrecord class.- Parameters:
key- the value for thekeyrecord componentleftValue- the value for theleftValuerecord componentrightValue- the value for therightValuerecord component
-
-
Method Details
-
forLeftValueOnly
-
forRightValueOnly
-
forDifferingValues
public static <K,V> MapsDifference.Entry<K,V> forDifferingValues(K pKey, V pLeftValue, V pRightValue) -
getKey
Deprecated.Returns the map key. -
getLeftValue
Deprecated.Returns the left value, if present. -
getRightValue
Deprecated.Returns the right value, if present. -
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
leftValue
Returns the value of theleftValuerecord component.- Returns:
- the value of the
leftValuerecord component
-
rightValue
Returns the value of therightValuerecord component.- Returns:
- the value of the
rightValuerecord component
-