package io.burt.jmespath.node;

import io.burt.jmespath.Adapter;

public class StringNode<T> extends Node<T> {
  private final String string;

  public StringNode(Adapter<T> runtime, String string) {
    super(runtime);
    this.string = string;
  }

  @Override
  public T search(T input) {
    return runtime.createString(string);
  }

  @Override
  public String toString() {
    return String.format("String(%s)", string);
  }

  @Override
  protected boolean internalEquals(Object o) {
    StringNode<?> other = (StringNode<?>) o;
    return string.equals(other.string);
  }

  @Override
  protected int internalHashCode() {
    return string.hashCode();
  }
}

@@ -123,24 +123,53 @@
 inal String 
+rawString;%0A  private final T 
 string;%0A%0A  p
@@ -212,17 +212,20 @@
  String 
-s
+rawS
 tring) %7B
@@ -258,23 +258,80 @@
 his.
-string = string
+rawString = rawString;%0A    this.string = runtime.createString(rawString)
 ;%0A  
@@ -389,36 +389,14 @@
 urn 
-runtime.createString(
 string
-)
 ;%0A  
@@ -478,17 +478,20 @@
 g(%25s)%22, 
-s
+rawS
 tring);%0A
@@ -606,25 +606,28 @@
 %0A    return 
-s
+rawS
 tring.equals
@@ -633,17 +633,20 @@
 s(other.
-s
+rawS
 tring);%0A
@@ -706,25 +706,28 @@
 %0A    return 
-s
+rawS
 tring.hashCo

Optimize StringNode