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

com.squarespace.template.expr.StringToken Maven / Gradle / Ivy

There is a newer version: 2.10.0
Show newest version
package com.squarespace.template.expr;

import java.util.Objects;

import com.fasterxml.jackson.databind.node.TextNode;

/**
 * Token representing a string value.
 */
public class StringToken extends Token {

  public final String value;

  public StringToken(String value) {
    super(ExprTokenType.STRING);
    this.value = value;
  }

  @Override
  public boolean equals(Object obj) {
    if (obj instanceof StringToken) {
      return Objects.equals(value, ((StringToken)obj).value);
    }
    return false;
  }

  @Override
  public String toString() {
    return "StringToken[" + new TextNode(this.value) + "]";
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy