Record Class SimpleMapping
java.lang.Object
java.lang.Record
org.openehealth.ipf.commons.map.SimpleMapping
- Record Components:
name- mapping name, unique within aMappingsinstancekeySystem- formal identifier (usually an OID or a URI) of the key code system, may benullvalueSystem- formal identifier of the value code system, may benullentries- the key/value pairs, in declaration orderunmatched- what to answer when a key has no entry, nevernullreverseUnmatched- what to answer when a value has no entry, nevernullreversible- whether a reverse index is built at all. A one-directional mapping may legally map several keys onto the same valueoverride- whether this declaration is meant to replace a mapping of the same name loaded earlier. Without it, a duplicate name is a load-time error
- All Implemented Interfaces:
Mapping
public record SimpleMapping(String name, String keySystem, String valueSystem, List<Entry> entries, Unmatched unmatched, Unmatched reverseUnmatched, boolean reversible, boolean override)
extends Record
implements Mapping
A translation table: entries of its own, the identifiers of the two code systems involved, and
the fallback behavior for either direction. This is what every
MappingLoader reads a
table in its format into, and what every MappingWriter writes.- Since:
- 6.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable helper forMappingLoaderimplementations, which assemble a mapping incrementally while walking their source document. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleMapping.Builderentries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thekeySystemrecord component.name()Returns the value of thenamerecord component.booleanoverride()Returns the value of theoverriderecord component.parts()Returns the value of thereverseUnmatchedrecord component.booleanReturns the value of thereversiblerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theunmatchedrecord component.Returns the value of thevalueSystemrecord component.
-
Constructor Details
-
SimpleMapping
public SimpleMapping(String name, String keySystem, String valueSystem, List<Entry> entries, Unmatched unmatched, Unmatched reverseUnmatched, boolean reversible, boolean override) Creates an instance of aSimpleMappingrecord class.- Parameters:
name- the value for thenamerecord componentkeySystem- the value for thekeySystemrecord componentvalueSystem- the value for thevalueSystemrecord componententries- the value for theentriesrecord componentunmatched- the value for theunmatchedrecord componentreverseUnmatched- the value for thereverseUnmatchedrecord componentreversible- the value for thereversiblerecord componentoverride- the value for theoverriderecord component
-
-
Method Details
-
parts
-
builder
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
keySystem
-
valueSystem
Returns the value of thevalueSystemrecord component.- Specified by:
valueSystemin interfaceMapping- Returns:
- the value of the
valueSystemrecord component
-
entries
-
unmatched
-
reverseUnmatched
Returns the value of thereverseUnmatchedrecord component.- Specified by:
reverseUnmatchedin interfaceMapping- Returns:
- the value of the
reverseUnmatchedrecord component
-
reversible
public boolean reversible()Returns the value of thereversiblerecord component.- Specified by:
reversiblein interfaceMapping- Returns:
- the value of the
reversiblerecord component
-
override
-