Package cs1302.tracer.trace
Record Class TraceValue.Map
java.lang.Object
java.lang.Record
cs1302.tracer.trace.TraceValue.Map
- Record Components:
typeName- Map type name.value- Key-value map entries.
- All Implemented Interfaces:
TraceValue
- Enclosing interface:
TraceValue
public static record TraceValue.Map(String typeName, Map<? extends TraceValue,? extends TraceValue> value)
extends Record
implements TraceValue
An object that implements
Map.-
Nested Class Summary
Nested classes/interfaces inherited from interface cs1302.tracer.trace.TraceValue
TraceValue.Collection, TraceValue.Color, TraceValue.Lambda, TraceValue.List, TraceValue.Map, TraceValue.Null, TraceValue.Object, TraceValue.Primitive, TraceValue.Reference, TraceValue.String -
Constructor Summary
ConstructorsConstructorDescriptionMap(String typeName, Map<? extends TraceValue, ? extends TraceValue> value) Creates an instance of aMaprecord class.Map(Map<? extends TraceValue, ? extends TraceValue> value) Convenience constructor with default typeName. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.static Optional<TraceValue.Map> tryFromJdiObjectReference(ThreadReference mainThread, ObjectReference or, Optional<List<ObjectReference>> outEncounteredReferences) Try to convert a mirrored JDI object into a Map TraceValue.typeName()Returns the value of thetypeNamerecord component.Map<? extends TraceValue, ? extends TraceValue> value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Method Details
-
tryFromJdiObjectReference
public static Optional<TraceValue.Map> tryFromJdiObjectReference(ThreadReference mainThread, ObjectReference or, Optional<List<ObjectReference>> outEncounteredReferences) Try to convert a mirrored JDI object into a Map TraceValue.- Parameters:
mainThread- The thread associated with the value you want to convert.or- The mirrored JDI object to convert.outEncounteredReferences- An out parameter for references.- Returns:
- The converted Map TraceValue, or empty if conversion failed.
-
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). -
typeName
Returns the value of thetypeNamerecord component.- Returns:
- the value of the
typeNamerecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-