/** * Retrieves the literal value * * @param literal JmesPath literal type * @param input Input json node against which evaluation is done * @return Literal value */ @Override public JsonNode visit(JmesPathLiteral literal, JsonNode input) { return literal.getValue(); }
/** * Generates the code for a new JmesPathField. * * @param fieldNode JmesPath field type * @param aVoid void * @return String that represents a call to * the new fieldNode */ @Override public String visit(final JmesPathField fieldNode, final Void aVoid) { return "new JmesPathField( \"" + fieldNode.getValue() + "\")"; }
/** * Generates the code for a new JmesPathNotExpression. * * @param notExpression JmesPath not-expression type * @param aVoid void * @return String that represents a call to * the new not-expression * @throws InvalidTypeException */ @Override public String visit(final JmesPathNotExpression notExpression, final Void aVoid) throws InvalidTypeException { return "new JmesPathNotExpression( " + notExpression.getExpr() .accept(this, aVoid) + " )"; }
/** * Takes the result and determines whether the state of the resource matches the expected state. To determine * the current state of the resource, JmesPath expression is evaluated and compared against the expected result. * * @param result * Corresponding result of the operation * @return True if current state of the resource matches the expected state, False otherwise */ @Override public boolean matches(ReadJobResult result) { JsonNode queryNode = ObjectMapperSingleton.getObjectMapper().valueToTree(result); JsonNode finalResult = ast.accept(new JmesPathEvaluationVisitor(), queryNode); return AcceptorPathMatcher.path(expectedResult, finalResult); }
/** * Generates the code for a new JmesPathFilter. * * @param filter JmesPath filter type * @param aVoid void * @return String that represents a call to * the new filter expression * @throws InvalidTypeException */ @Override public String visit(final JmesPathFilter filter, final Void aVoid) throws InvalidTypeException { return "new JmesPathFilter( " + filter.getLhsExpr().accept(this, aVoid) + ", " + filter.getRhsExpr().accept(this, aVoid) + ", " + filter.getComparator().accept(this, aVoid) + ")"; }
/** * Evaluate the expressions as per the given comparison * operator. * * @param op JmesPath comparison operator type * @param input Input json node against which evaluation is done * @return Result of the comparison */ @Override public JsonNode visit(Comparator op, JsonNode input) { JsonNode lhsNode = op.getLhsExpr().accept(this, input); JsonNode rhsNode = op.getRhsExpr().accept(this, input); if (op.matches(lhsNode, rhsNode)) { return BooleanNode.TRUE; } return BooleanNode.FALSE; }
/** * Generates the code for a new JmesPathAndExpression. * * @param andExpression JmesPath and-expression type * @param aVoid void * @return String that represents a call to * the new and-expression * @throws InvalidTypeException */ @Override public String visit(final JmesPathAndExpression andExpression, final Void aVoid) throws InvalidTypeException { return "new JmesPathAndExpression( " + andExpression.getLhsExpr() .accept(this, aVoid) + ", " + andExpression.getRhsExpr() .accept(this, aVoid) + " )"; }
/** * Generates the code for a new JmesPathProjection. * * @param jmesPathProjection JmesPath projection type * @param aVoid void * @return String that represents a call to * the new list projection * @throws InvalidTypeException */ @Override public String visit(final JmesPathProjection jmesPathProjection, final Void aVoid) throws InvalidTypeException { return "new JmesPathProjection( " + jmesPathProjection.getLhsExpr() .accept(this, aVoid) + ", " + jmesPathProjection.getProjectionExpr() .accept(this, aVoid) + ")"; }
/** * Generates the code for a new JmesPathValueProjection. * * @param valueProjection JmesPath value projection type * @param aVoid void * @return String that represents a call to * the new value projection * @throws InvalidTypeException */ @Override public String visit(final JmesPathValueProjection valueProjection, final Void aVoid) throws InvalidTypeException { return "new JmesPathValueProjection( " + valueProjection.getLhsExpr() .accept(this, aVoid) + ", " + valueProjection.getRhsExpr() .accept(this, aVoid) + ")"; }
/** * Generates the code for a new JmesPathFlatten. * * @param flatten JmesPath flatten type * @param aVoid void * @return String that represents a call to * the new flatten projection * @throws InvalidTypeException */ @Override public String visit(final JmesPathFlatten flatten, final Void aVoid) throws InvalidTypeException { return "new JmesPathFlatten( " + flatten.getFlattenExpr() .accept(this, aVoid) + ")"; }
/** * Takes the result and determines whether the state of the resource matches the expected state. To determine * the current state of the resource, JmesPath expression is evaluated and compared against the expected result. * * @param result * Corresponding result of the operation * @return True if current state of the resource matches the expected state, False otherwise */ @Override public boolean matches(DescribeClusterResult result) { JsonNode queryNode = ObjectMapperSingleton.getObjectMapper().valueToTree(result); JsonNode finalResult = ast.accept(new JmesPathEvaluationVisitor(), queryNode); return AcceptorPathMatcher.path(expectedResult, finalResult); }
/** * Takes the result and determines whether the state of the resource matches the expected state. To determine * the current state of the resource, JmesPath expression is evaluated and compared against the expected result. * * @param result * Corresponding result of the operation * @return True if current state of the resource matches the expected state, False otherwise */ @Override public boolean matches(DescribeClusterResult result) { JsonNode queryNode = ObjectMapperSingleton.getObjectMapper().valueToTree(result); JsonNode finalResult = ast.accept(new JmesPathEvaluationVisitor(), queryNode); return AcceptorPathMatcher.path(expectedResult, finalResult); }
/** * Takes the result and determines whether the state of the resource matches the expected state. To determine * the current state of the resource, JmesPath expression is evaluated and compared against the expected result. * * @param result * Corresponding result of the operation * @return True if current state of the resource matches the expected state, False otherwise */ @Override public boolean matches(DescribeTargetHealthResult result) { JsonNode queryNode = ObjectMapperSingleton.getObjectMapper().valueToTree(result); JsonNode finalResult = ast.accept(new JmesPathEvaluationVisitor(), queryNode); return AcceptorPathMatcher.pathAll(expectedResult, finalResult); }
/** * Takes the result and determines whether the state of the resource matches the expected state. To determine * the current state of the resource, JmesPath expression is evaluated and compared against the expected result. * * @param result * Corresponding result of the operation * @return True if current state of the resource matches the expected state, False otherwise */ @Override public boolean matches(DescribeDBInstancesResult result) { JsonNode queryNode = ObjectMapperSingleton.getObjectMapper().valueToTree(result); JsonNode finalResult = ast.accept(new JmesPathEvaluationVisitor(), queryNode); return AcceptorPathMatcher.pathAny(expectedResult, finalResult); }
/** * Takes the result and determines whether the state of the resource matches the expected state. To determine * the current state of the resource, JmesPath expression is evaluated and compared against the expected result. * * @param result * Corresponding result of the operation * @return True if current state of the resource matches the expected state, False otherwise */ @Override public boolean matches(DescribeReplicationTasksResult result) { JsonNode queryNode = ObjectMapperSingleton.getObjectMapper().valueToTree(result); JsonNode finalResult = ast.accept(new JmesPathEvaluationVisitor(), queryNode); return AcceptorPathMatcher.pathAny(expectedResult, finalResult); }
/** * Takes the result and determines whether the state of the resource matches the expected state. To determine * the current state of the resource, JmesPath expression is evaluated and compared against the expected result. * * @param result * Corresponding result of the operation * @return True if current state of the resource matches the expected state, False otherwise */ @Override public boolean matches(DescribeReplicationTasksResult result) { JsonNode queryNode = ObjectMapperSingleton.getObjectMapper().valueToTree(result); JsonNode finalResult = ast.accept(new JmesPathEvaluationVisitor(), queryNode); return AcceptorPathMatcher.pathAny(expectedResult, finalResult); }
/** * Takes the result and determines whether the state of the resource matches the expected state. To determine * the current state of the resource, JmesPath expression is evaluated and compared against the expected result. * * @param result * Corresponding result of the operation * @return True if current state of the resource matches the expected state, False otherwise */ @Override public boolean matches(DescribeStepResult result) { JsonNode queryNode = ObjectMapperSingleton.getObjectMapper().valueToTree(result); JsonNode finalResult = ast.accept(new JmesPathEvaluationVisitor(), queryNode); return AcceptorPathMatcher.path(expectedResult, finalResult); }
/** * Takes the result and determines whether the state of the resource matches the expected state. To determine * the current state of the resource, JmesPath expression is evaluated and compared against the expected result. * * @param result * Corresponding result of the operation * @return True if current state of the resource matches the expected state, False otherwise */ @Override public boolean matches(DescribeInstancesResult result) { JsonNode queryNode = ObjectMapperSingleton.getObjectMapper().valueToTree(result); JsonNode finalResult = ast.accept(new JmesPathEvaluationVisitor(), queryNode); return AcceptorPathMatcher.pathAny(expectedResult, finalResult); }
/** * Takes the result and determines whether the state of the resource matches the expected state. To determine * the current state of the resource, JmesPath expression is evaluated and compared against the expected result. * * @param result * Corresponding result of the operation * @return True if current state of the resource matches the expected state, False otherwise */ @Override public boolean matches(DescribeDBInstancesResult result) { JsonNode queryNode = ObjectMapperSingleton.getObjectMapper().valueToTree(result); JsonNode finalResult = ast.accept(new JmesPathEvaluationVisitor(), queryNode); return AcceptorPathMatcher.pathAny(expectedResult, finalResult); }
/** * Takes the result and determines whether the state of the resource matches the expected state. To determine * the current state of the resource, JmesPath expression is evaluated and compared against the expected result. * * @param result * Corresponding result of the operation * @return True if current state of the resource matches the expected state, False otherwise */ @Override public boolean matches(DescribeDeploymentsResult result) { JsonNode queryNode = ObjectMapperSingleton.getObjectMapper().valueToTree(result); JsonNode finalResult = ast.accept(new JmesPathEvaluationVisitor(), queryNode); return AcceptorPathMatcher.pathAny(expectedResult, finalResult); }