io.burt.jmespath.node.JsonLiteralNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmespath-core Show documentation
Show all versions of jmespath-core Show documentation
A JMESPath implementation for Java
package io.burt.jmespath.node;
import io.burt.jmespath.Adapter;
public class JsonLiteralNode extends Node {
private final String rawValue;
private final T value;
public JsonLiteralNode(Adapter runtime, String rawValue) {
super(runtime);
this.rawValue = rawValue;
this.value = runtime.parseString(rawValue);
}
@Override
public T search(T input) {
return value;
}
@Override
protected String internalToString() {
return rawValue;
}
@Override
protected boolean internalEquals(Object o) {
JsonLiteralNode other = (JsonLiteralNode) o;
return rawValue.equals(other.rawValue);
}
@Override
protected int internalHashCode() {
return rawValue.hashCode();
}
}