Record Class Unmatched.Delegate

java.lang.Object
java.lang.Record
org.openehealth.ipf.commons.map.Unmatched.Delegate
All Implemented Interfaces:
Unmatched
Enclosing interface:
Unmatched

public static record Unmatched.Delegate(String mapping) extends Record implements Unmatched
Another mapping answers instead. The named mapping is asked in full - its entries first and then its own unmatched behaviour - so it is that mapping which finally decides the outcome, and a chain of delegations ends at the first mapping whose fallback is not itself a delegation.

This is how a mapping specialises another without restating it: declare the codes that differ and delegate the rest. Corresponds to unmapped.mode = other-map in FHIR ConceptMap.

The named mapping must already be registered, which is what makes a cycle impossible to declare. A name without a version also finds the only mapping registered as name|version, the way a versionless FHIR canonical refers to the one version at hand; with several such versions it is ambiguous and rejected.

Since:
6.0
  • Constructor Details

    • Delegate

      public Delegate(String mapping)
      Creates an instance of a Delegate record class.
      Parameters:
      mapping - the value for the mapping record component
  • Method Details

    • 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.
    • mapping

      public String mapping()
      Returns the value of the mapping record component.
      Returns:
      the value of the mapping record component