Record Class MetadataValueMapper<T>
java.lang.Object
java.lang.Record
gov.nasa.jpl.aerie.merlin.framework.MetadataValueMapper<T>
- All Implemented Interfaces:
ValueMapper<T>
public record MetadataValueMapper<T>(String label, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue metadata, ValueMapper<T> target)
extends Record
implements ValueMapper<T>
-
Constructor Summary
ConstructorsConstructorDescriptionMetadataValueMapper(String label, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue metadata, ValueMapper<T> target) Creates an instance of aMetadataValueMapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,A extends Annotation>
ValueMapper<T> annotationValueMapper(String key, ValueMapper<T> TValueMapper, ValueMapper<A> annotationValueMapper, A annotation) deserializeValue(gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue serializedValue) Produces an mission model-specific domain value from a mission-agnostic representation.final booleanIndicates whether some other object is "equal to" this one.gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchemaGets a schema for the kind of value understood by this ValueMapper.final inthashCode()Returns a hash code value for this object.label()Returns the value of thelabelrecord component.gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValuemetadata()Returns the value of themetadatarecord component.gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValueserializeValue(T value) Produces a mission-agnostic representation of an mission model-specific domain value.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MetadataValueMapper
public MetadataValueMapper(String label, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue metadata, ValueMapper<T> target) Creates an instance of aMetadataValueMapperrecord class.- Parameters:
label- the value for thelabelrecord componentmetadata- the value for themetadatarecord componenttarget- the value for thetargetrecord component
-
-
Method Details
-
getValueSchema
public gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema getValueSchema()Description copied from interface:ValueMapperGets a schema for the kind of value understood by this ValueMapper.- Specified by:
getValueSchemain interfaceValueMapper<T>- Returns:
- A parameter schema.
-
deserializeValue
public Result<T,String> deserializeValue(gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue serializedValue) Description copied from interface:ValueMapperProduces an mission model-specific domain value from a mission-agnostic representation.- Specified by:
deserializeValuein interfaceValueMapper<T>- Parameters:
serializedValue- A mission-agnostic representation of a domain value.- Returns:
- Either an mission model-specific domain object, or a deserialization failure.
-
serializeValue
Description copied from interface:ValueMapperProduces a mission-agnostic representation of an mission model-specific domain value.- Specified by:
serializeValuein interfaceValueMapper<T>- Parameters:
value- An mission model-specific domain object.- Returns:
- A mission-agnostic representation of
value.
-
annotationValueMapper
public static <T,A extends Annotation> ValueMapper<T> annotationValueMapper(String key, ValueMapper<T> TValueMapper, ValueMapper<A> annotationValueMapper, A annotation) -
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). -
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
metadata
public gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue metadata()Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-