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

    Constructors
    Constructor
    Description
    MetadataValueMapper(String label, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue metadata, ValueMapper<T> target)
    Creates an instance of a MetadataValueMapper record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <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 boolean
    Indicates whether some other object is "equal to" this one.
    gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema
    Gets a schema for the kind of value understood by this ValueMapper.
    final int
    Returns a hash code value for this object.
    Returns the value of the label record component.
    gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue
    Returns the value of the metadata record component.
    gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue
    Produces a mission-agnostic representation of an mission model-specific domain value.
    Returns the value of the target record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MetadataValueMapper

      public MetadataValueMapper(String label, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue metadata, ValueMapper<T> target)
      Creates an instance of a MetadataValueMapper record class.
      Parameters:
      label - the value for the label record component
      metadata - the value for the metadata record component
      target - the value for the target record component
  • Method Details

    • getValueSchema

      public gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema getValueSchema()
      Description copied from interface: ValueMapper
      Gets a schema for the kind of value understood by this ValueMapper.
      Specified by:
      getValueSchema in interface ValueMapper<T>
      Returns:
      A parameter schema.
    • deserializeValue

      public Result<T,String> deserializeValue(gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue serializedValue)
      Description copied from interface: ValueMapper
      Produces an mission model-specific domain value from a mission-agnostic representation.
      Specified by:
      deserializeValue in interface ValueMapper<T>
      Parameters:
      serializedValue - A mission-agnostic representation of a domain value.
      Returns:
      Either an mission model-specific domain object, or a deserialization failure.
    • serializeValue

      public gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue serializeValue(T value)
      Description copied from interface: ValueMapper
      Produces a mission-agnostic representation of an mission model-specific domain value.
      Specified by:
      serializeValue in interface ValueMapper<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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • label

      public String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • metadata

      public gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component
    • target

      public ValueMapper<T> target()
      Returns the value of the target record component.
      Returns:
      the value of the target record component