Record Class AnnotatedValue<T>
java.lang.Object
java.lang.Record
org.sosy_lab.common.configuration.AnnotatedValue<T>
@Immutable(containerOf="T")
public record AnnotatedValue<T>(T value, Optional<String> annotation)
extends Record
Immutable container that stores a value and an optional string.
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedValue(T value, Optional<String> annotation) Creates an instance of aAnnotatedValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theannotationrecord component.static <T> AnnotatedValue<T>create(T value) static <T> AnnotatedValue<T>static <T> AnnotatedValue<T>final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
AnnotatedValue
Creates an instance of aAnnotatedValuerecord class.- Parameters:
value- the value for thevaluerecord componentannotation- the value for theannotationrecord component
-
-
Method Details
-
create
-
create
-
create
-
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). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
annotation
Returns the value of theannotationrecord component.- Returns:
- the value of the
annotationrecord component
-