Package lib.aide
Record Class JsonContentAction.ApplyKeyValuePairs
java.lang.Object
java.lang.Record
lib.aide.JsonContentAction.ApplyKeyValuePairs
- All Implemented Interfaces:
JsonContentAction.InjectJson
- Enclosing class:
JsonContentAction
public static record JsonContentAction.ApplyKeyValuePairs(com.jayway.jsonpath.JsonPath injectInJsonPath, Map<String,String> spelExpressions)
extends Record
implements JsonContentAction.InjectJson
ApplyKeyValuePairs assumes that
injectInJsonPath
is a map and applies
the evaluated SpEL expressions as key-value pairs.-
Constructor Summary
ConstructorDescriptionApplyKeyValuePairs
(com.jayway.jsonpath.JsonPath injectInJsonPath, Map<String, String> spelExpressions) Creates an instance of aApplyKeyValuePairs
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.com.jayway.jsonpath.JsonPath
Returns the value of theinjectInJsonPath
record component.void
perform
(Map<String, Object> targetJson, org.springframework.expression.spel.support.StandardEvaluationContext spelContext, org.springframework.expression.ExpressionParser parser) Performs the transformation on the target JSON based on the SpEL expressions provided.Returns the value of thespelExpressions
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ApplyKeyValuePairs
public ApplyKeyValuePairs(com.jayway.jsonpath.JsonPath injectInJsonPath, Map<String, String> spelExpressions) Creates an instance of aApplyKeyValuePairs
record class.- Parameters:
injectInJsonPath
- the value for theinjectInJsonPath
record componentspelExpressions
- the value for thespelExpressions
record component
-
-
Method Details
-
perform
public void perform(Map<String, Object> targetJson, org.springframework.expression.spel.support.StandardEvaluationContext spelContext, org.springframework.expression.ExpressionParser parser) Description copied from interface:JsonContentAction.InjectJson
Performs the transformation on the target JSON based on the SpEL expressions provided.- Specified by:
perform
in interfaceJsonContentAction.InjectJson
- Parameters:
targetJson
- the target JSON to be transformedspelContext
- the Spring SpEL evaluation contextparser
- the SpEL expression parser
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
injectInJsonPath
public com.jayway.jsonpath.JsonPath injectInJsonPath()Returns the value of theinjectInJsonPath
record component.- Returns:
- the value of the
injectInJsonPath
record component
-
spelExpressions
Returns the value of thespelExpressions
record component.- Returns:
- the value of the
spelExpressions
record component
-