Class DataMappingResult
java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.core.FoundationObject
com.northconcepts.datapipeline.foundations.datamapping.DataMappingObject
com.northconcepts.datapipeline.foundations.datamapping.DataMappingResult
- All Implemented Interfaces:
DataExceptionContributor,JsonSerializable,RecordSerializable,XmlSerializable,Serializable
The outcome of mapping one record with a
DataMapping: the target record plus any failed condition, field
mapping exceptions and schema validation results.- See Also:
-
Field Summary
Fields inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
internalId, internalName, log, TIMESTAMP_FORMATFields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the expression text of the failed condition, or null if none failed.static DataMappingResultgetDataMappingResult(Record record) Returns the result attached to the record bysetDataMappingResult(Record, DataMappingResult), or null if there is none.Returns the source and target entity validation errors combined, or an empty list if there are none.Returns the exceptions thrown by field mappings, keyed by target field name, or null if none were recorded.getExceptions(boolean create) Returns the exceptions thrown by field mappings, keyed by target field name, creating the map first ifcreateis true (otherwise null when none were recorded).LogicalExpressionReturns the first mapping condition that was false, or null if none failed.Returns the source record, which aDataMappingonly sets when it has a source entity.Returns the result of validating the source record against the mapping's source entity, or null if it was not validated.Returns the mapped record, or null if a condition or the source entity validation failed.Returns the result of validating the target record against the mapping's target entity, or null if it was not validated.Deprecated.booleanbooleanbooleanbooleanPrints each field mapping exception and its stack trace to standard error.logExceptions(PrintStream printStream) Prints the field name and message of each validation error to standard error.logValidationErrors(PrintStream printStream) static voidsetDataMappingResult(Record record, DataMappingResult result) Attaches the result to the record as a session property; does nothing if the record is null.setFailedCondition(LogicalExpression failedCondition) Sets the mapping condition that was false, which stops the record from being mapped.Sets the source record (aDataMappingonly sets it when it has a source entity).setSourceEntityResult(ValidationResult sourceEntityResult) Sets the result of validating the source record against the mapping's source entity.Sets the mapped record (left null when a condition or the source entity validation failed).setTargetEntityResult(ValidationResult targetEntityResult) Sets the result of validating the target record against the mapping's target entity.setTargetValidationResult(ValidationResult targetValidationResult) Deprecated.Methods inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
addExceptionProperties, assertValid, assertValid, clone, exception, exception, exception, getInternalId, getInternalName, resetInternalIdMethods inherited from class com.northconcepts.datapipeline.foundations.core.Bean
fromRecord, toRecord, toStringMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionPropertiesMethods inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
fromJson, fromJson, toJson, toJson, toJsonMethods inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
fromXml, fromXml, fromXmlElement, toXml, toXml, toXml, toXml, toXml, toXmlElement
-
Constructor Details
-
DataMappingResult
public DataMappingResult()
-
-
Method Details
-
getSource
Returns the source record, which aDataMappingonly sets when it has a source entity. -
setSource
Sets the source record (aDataMappingonly sets it when it has a source entity). -
getSourceAsJson
-
getTarget
Returns the mapped record, or null if a condition or the source entity validation failed. -
setTarget
Sets the mapped record (left null when a condition or the source entity validation failed). -
getTargetAsJson
-
getFailedCondition
public LogicalExpression getFailedCondition()Returns the first mapping condition that was false, or null if none failed. -
setFailedCondition
Sets the mapping condition that was false, which stops the record from being mapped. -
getConditionFailedSource
Returns the expression text of the failed condition, or null if none failed. -
getExceptions
Returns the exceptions thrown by field mappings, keyed by target field name, creating the map first ifcreateis true (otherwise null when none were recorded). -
getExceptions
Returns the exceptions thrown by field mappings, keyed by target field name, or null if none were recorded. -
hasExceptions
public boolean hasExceptions() -
logExceptions
Prints each field mapping exception and its stack trace to standard error. -
logExceptions
-
getErrors
Returns the source and target entity validation errors combined, or an empty list if there are none. -
getSourceEntityResult
Returns the result of validating the source record against the mapping's source entity, or null if it was not validated. -
setSourceEntityResult
Sets the result of validating the source record against the mapping's source entity. -
getTargetEntityResult
Returns the result of validating the target record against the mapping's target entity, or null if it was not validated. -
setTargetEntityResult
Sets the result of validating the target record against the mapping's target entity. -
getTargetValidationResult
Deprecated.UsegetTargetEntityResult()instead. -
setTargetValidationResult
@Deprecated public DataMappingResult setTargetValidationResult(ValidationResult targetValidationResult) Deprecated.UsesetTargetEntityResult(ValidationResult)instead. -
hasSourceValidationErrors
public boolean hasSourceValidationErrors() -
hasTargetValidationErrors
public boolean hasTargetValidationErrors() -
hasValidationErrors
public boolean hasValidationErrors() -
logValidationErrors
Prints the field name and message of each validation error to standard error. -
logValidationErrors
-
getDataMappingResult
Returns the result attached to the record bysetDataMappingResult(Record, DataMappingResult), or null if there is none. -
setDataMappingResult
Attaches the result to the record as a session property; does nothing if the record is null.
-