Class MockPropertyValue

java.lang.Object
org.apache.nifi.util.MockPropertyValue
All Implemented Interfaces:
org.apache.nifi.components.PropertyValue

public class MockPropertyValue extends Object implements org.apache.nifi.components.PropertyValue
  • Field Details

    • rawValue

      private final String rawValue
    • expectExpressions

      private final Boolean expectExpressions
    • expressionLanguageScope

      private final org.apache.nifi.expression.ExpressionLanguageScope expressionLanguageScope
    • serviceLookup

      private final MockControllerServiceLookup serviceLookup
    • propertyDescriptor

      private final org.apache.nifi.components.PropertyDescriptor propertyDescriptor
    • stdPropValue

      private final org.apache.nifi.components.PropertyValue stdPropValue
    • environmentVariables

      private Map<String,String> environmentVariables
    • expressionsEvaluated

      private boolean expressionsEvaluated
  • Constructor Details

    • MockPropertyValue

      public MockPropertyValue(String rawValue)
    • MockPropertyValue

      public MockPropertyValue(String rawValue, Map<String,String> environmentVariables)
    • MockPropertyValue

      public MockPropertyValue(String rawValue, org.apache.nifi.controller.ControllerServiceLookup serviceLookup, Map<String,String> environmentVariables)
    • MockPropertyValue

      public MockPropertyValue(String rawValue, org.apache.nifi.controller.ControllerServiceLookup serviceLookup, Map<String,String> environmentVariables, ParameterLookup parameterLookup)
    • MockPropertyValue

      public MockPropertyValue(String rawValue, org.apache.nifi.controller.ControllerServiceLookup serviceLookup, org.apache.nifi.components.PropertyDescriptor propertyDescriptor, Map<String,String> environmentVariables)
    • MockPropertyValue

      protected MockPropertyValue(String rawValue, org.apache.nifi.controller.ControllerServiceLookup serviceLookup, org.apache.nifi.components.PropertyDescriptor propertyDescriptor, boolean alreadyEvaluated, Map<String,String> environmentVariables)
    • MockPropertyValue

      protected MockPropertyValue(String rawValue, org.apache.nifi.controller.ControllerServiceLookup serviceLookup, org.apache.nifi.components.PropertyDescriptor propertyDescriptor, boolean alreadyEvaluated, Map<String,String> environmentVariables, ParameterLookup parameterLookup)
  • Method Details

    • ensureExpressionsEvaluated

      private void ensureExpressionsEvaluated()
    • validateExpressionScope

      private void validateExpressionScope(boolean flowFileProvided, boolean additionalAttributesAvailable)
    • getValue

      public String getValue()
      Specified by:
      getValue in interface org.apache.nifi.components.PropertyValue
    • asInteger

      public Integer asInteger()
      Specified by:
      asInteger in interface org.apache.nifi.components.PropertyValue
    • asLong

      public Long asLong()
      Specified by:
      asLong in interface org.apache.nifi.components.PropertyValue
    • asBoolean

      public Boolean asBoolean()
      Specified by:
      asBoolean in interface org.apache.nifi.components.PropertyValue
    • asFloat

      public Float asFloat()
      Specified by:
      asFloat in interface org.apache.nifi.components.PropertyValue
    • asDouble

      public Double asDouble()
      Specified by:
      asDouble in interface org.apache.nifi.components.PropertyValue
    • asTimePeriod

      public Long asTimePeriod(TimeUnit timeUnit)
      Specified by:
      asTimePeriod in interface org.apache.nifi.components.PropertyValue
    • asDuration

      public Duration asDuration()
      Specified by:
      asDuration in interface org.apache.nifi.components.PropertyValue
    • asDataSize

      public Double asDataSize(org.apache.nifi.processor.DataUnit dataUnit)
      Specified by:
      asDataSize in interface org.apache.nifi.components.PropertyValue
    • markEvaluated

      private void markEvaluated()
    • evaluateAttributeExpressions

      public org.apache.nifi.components.PropertyValue evaluateAttributeExpressions() throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      evaluateAttributeExpressions in interface org.apache.nifi.components.PropertyValue
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • evaluateAttributeExpressions

      public org.apache.nifi.components.PropertyValue evaluateAttributeExpressions(org.apache.nifi.expression.AttributeValueDecorator decorator) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      evaluateAttributeExpressions in interface org.apache.nifi.components.PropertyValue
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • evaluateAttributeExpressions

      public org.apache.nifi.components.PropertyValue evaluateAttributeExpressions(org.apache.nifi.flowfile.FlowFile flowFile) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      evaluateAttributeExpressions in interface org.apache.nifi.components.PropertyValue
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • evaluateAttributeExpressions

      public org.apache.nifi.components.PropertyValue evaluateAttributeExpressions(org.apache.nifi.flowfile.FlowFile flowFile, org.apache.nifi.expression.AttributeValueDecorator decorator) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      evaluateAttributeExpressions in interface org.apache.nifi.components.PropertyValue
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • evaluateAttributeExpressions

      public org.apache.nifi.components.PropertyValue evaluateAttributeExpressions(org.apache.nifi.flowfile.FlowFile flowFile, Map<String,String> additionalAttributes) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      evaluateAttributeExpressions in interface org.apache.nifi.components.PropertyValue
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • evaluateAttributeExpressions

      public org.apache.nifi.components.PropertyValue evaluateAttributeExpressions(Map<String,String> attributes) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      evaluateAttributeExpressions in interface org.apache.nifi.components.PropertyValue
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • evaluateAttributeExpressions

      public org.apache.nifi.components.PropertyValue evaluateAttributeExpressions(Map<String,String> attributes, org.apache.nifi.expression.AttributeValueDecorator decorator) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      evaluateAttributeExpressions in interface org.apache.nifi.components.PropertyValue
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • evaluateAttributeExpressions

      public org.apache.nifi.components.PropertyValue evaluateAttributeExpressions(org.apache.nifi.flowfile.FlowFile flowFile, Map<String,String> additionalAttributes, org.apache.nifi.expression.AttributeValueDecorator decorator) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      evaluateAttributeExpressions in interface org.apache.nifi.components.PropertyValue
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • evaluateAttributeExpressions

      public org.apache.nifi.components.PropertyValue evaluateAttributeExpressions(org.apache.nifi.flowfile.FlowFile flowFile, Map<String,String> additionalAttributes, org.apache.nifi.expression.AttributeValueDecorator decorator, Map<String,String> stateValues) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      evaluateAttributeExpressions in interface org.apache.nifi.components.PropertyValue
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • asControllerService

      public org.apache.nifi.controller.ControllerService asControllerService()
      Specified by:
      asControllerService in interface org.apache.nifi.components.PropertyValue
    • asControllerService

      public <T extends org.apache.nifi.controller.ControllerService> T asControllerService(Class<T> serviceType) throws IllegalArgumentException
      Specified by:
      asControllerService in interface org.apache.nifi.components.PropertyValue
      Throws:
      IllegalArgumentException
    • asResource

      public org.apache.nifi.components.resource.ResourceReference asResource()
      Specified by:
      asResource in interface org.apache.nifi.components.PropertyValue
    • asResources

      public org.apache.nifi.components.resource.ResourceReferences asResources()
      Specified by:
      asResources in interface org.apache.nifi.components.PropertyValue
    • asAllowableValue

      public <E extends Enum<E>> E asAllowableValue(Class<E> enumType) throws IllegalArgumentException
      Specified by:
      asAllowableValue in interface org.apache.nifi.components.PropertyValue
      Throws:
      IllegalArgumentException
    • isSet

      public boolean isSet()
      Specified by:
      isSet in interface org.apache.nifi.components.PropertyValue
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isExpressionLanguagePresent

      public boolean isExpressionLanguagePresent()
      Specified by:
      isExpressionLanguagePresent in interface org.apache.nifi.components.PropertyValue