Search in sources :

Example 6 with RecordPathResult

use of org.apache.nifi.record.path.RecordPathResult in project nifi by apache.

the class RecordPathSegment method evaluate.

@Override
public final RecordPathResult evaluate(final Record record, final FieldValue contextNode) {
    final RecordPathEvaluationContext context = new StandardRecordPathEvaluationContext(record);
    context.setContextNode(contextNode);
    final Stream<FieldValue> selectedFields = evaluate(context);
    return new RecordPathResult() {

        @Override
        public String getPath() {
            return RecordPathSegment.this.getPath();
        }

        @Override
        public Stream<FieldValue> getSelectedFields() {
            return selectedFields;
        }
    };
}
Also used : RecordPathResult(org.apache.nifi.record.path.RecordPathResult) FieldValue(org.apache.nifi.record.path.FieldValue) StandardRecordPathEvaluationContext(org.apache.nifi.record.path.StandardRecordPathEvaluationContext) StandardRecordPathEvaluationContext(org.apache.nifi.record.path.StandardRecordPathEvaluationContext) RecordPathEvaluationContext(org.apache.nifi.record.path.RecordPathEvaluationContext)

Aggregations

RecordPathResult (org.apache.nifi.record.path.RecordPathResult)6 FieldValue (org.apache.nifi.record.path.FieldValue)5 HashMap (java.util.HashMap)2 RecordPath (org.apache.nifi.record.path.RecordPath)2 RecordPathEvaluationContext (org.apache.nifi.record.path.RecordPathEvaluationContext)2 StandardRecordPathEvaluationContext (org.apache.nifi.record.path.StandardRecordPathEvaluationContext)2 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 DynamicProperty (org.apache.nifi.annotation.behavior.DynamicProperty)1 EventDriven (org.apache.nifi.annotation.behavior.EventDriven)1 InputRequirement (org.apache.nifi.annotation.behavior.InputRequirement)1 Requirement (org.apache.nifi.annotation.behavior.InputRequirement.Requirement)1