Package cs1302.tracer.trace
Record Class TraceValue.Object
java.lang.Object
java.lang.Record
cs1302.tracer.trace.TraceValue.Object
- Record Components:
classFqn- Declaring class FQN.fields- Object fields.enumConstant- Optional enum constant name if this object is an enum constant.
- All Implemented Interfaces:
TraceValue
- Enclosing interface:
TraceValue
public static record TraceValue.Object(String classFqn, Collection<ExecutionSnapshot.Field> fields, Optional<String> enumConstant)
extends Record
implements TraceValue
An object.
-
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
ConstructorsConstructorDescriptionObject(String classFqn, Collection<ExecutionSnapshot.Field> fields) Constructs an Object without an enum constant name.Object(String classFqn, Collection<ExecutionSnapshot.Field> fields, Optional<String> enumConstant) Creates an instance of aObjectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionclassFqn()Returns the value of theclassFqnrecord component.Returns the value of theenumConstantrecord component.final booleanIndicates whether some other object is "equal to" this one.fields()Returns the value of thefieldsrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Object
Constructs an Object without an enum constant name.- Parameters:
classFqn- Declaring class FQN.fields- Object fields.
-
Object
public Object(String classFqn, Collection<ExecutionSnapshot.Field> fields, Optional<String> enumConstant) Creates an instance of aObjectrecord class.- Parameters:
classFqn- the value for theclassFqnrecord componentfields- the value for thefieldsrecord componentenumConstant- the value for theenumConstantrecord component
-
-
Method Details
-
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). -
classFqn
Returns the value of theclassFqnrecord component.- Returns:
- the value of the
classFqnrecord component
-
fields
Returns the value of thefieldsrecord component.- Returns:
- the value of the
fieldsrecord component
-
enumConstant
Returns the value of theenumConstantrecord component.- Returns:
- the value of the
enumConstantrecord component
-