All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.burt.jmespath.node.JsonLiteralNode Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
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();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy