hydra.langs.cypher.openCypher.Literal Maven / Gradle / Ivy
package hydra.langs.cypher.openCypher;
import java.io.Serializable;
public abstract class Literal implements Serializable {
public static final hydra.core.Name NAME = new hydra.core.Name("hydra/langs/cypher/openCypher.Literal");
private Literal () {
}
public abstract R accept(Visitor visitor) ;
public interface Visitor {
R visit(Boolean_ instance) ;
R visit(Null instance) ;
R visit(Double_ instance) ;
R visit(Integer_ instance) ;
R visit(String_ instance) ;
R visit(List instance) ;
R visit(Map instance) ;
}
public interface PartialVisitor extends Visitor {
default R otherwise(Literal instance) {
throw new IllegalStateException("Non-exhaustive patterns when matching: " + (instance));
}
default R visit(Boolean_ instance) {
return otherwise((instance));
}
default R visit(Null instance) {
return otherwise((instance));
}
default R visit(Double_ instance) {
return otherwise((instance));
}
default R visit(Integer_ instance) {
return otherwise((instance));
}
default R visit(String_ instance) {
return otherwise((instance));
}
default R visit(List instance) {
return otherwise((instance));
}
default R visit(Map instance) {
return otherwise((instance));
}
}
public static final class Boolean_ extends hydra.langs.cypher.openCypher.Literal implements Serializable {
public final Boolean value;
public Boolean_ (Boolean value) {
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Boolean_)) {
return false;
}
Boolean_ o = (Boolean_) (other);
return value.equals(o.value);
}
@Override
public int hashCode() {
return 2 * value.hashCode();
}
@Override
public R accept(Visitor visitor) {
return visitor.visit(this);
}
}
public static final class Null extends hydra.langs.cypher.openCypher.Literal implements Serializable {
public Null () {
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Null)) {
return false;
}
Null o = (Null) (other);
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public R accept(Visitor visitor) {
return visitor.visit(this);
}
}
public static final class Double_ extends hydra.langs.cypher.openCypher.Literal implements Serializable {
public final Double value;
public Double_ (Double value) {
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Double_)) {
return false;
}
Double_ o = (Double_) (other);
return value.equals(o.value);
}
@Override
public int hashCode() {
return 2 * value.hashCode();
}
@Override
public R accept(Visitor visitor) {
return visitor.visit(this);
}
}
public static final class Integer_ extends hydra.langs.cypher.openCypher.Literal implements Serializable {
public final Integer value;
public Integer_ (Integer value) {
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Integer_)) {
return false;
}
Integer_ o = (Integer_) (other);
return value.equals(o.value);
}
@Override
public int hashCode() {
return 2 * value.hashCode();
}
@Override
public R accept(Visitor visitor) {
return visitor.visit(this);
}
}
public static final class String_ extends hydra.langs.cypher.openCypher.Literal implements Serializable {
public final String value;
public String_ (String value) {
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof String_)) {
return false;
}
String_ o = (String_) (other);
return value.equals(o.value);
}
@Override
public int hashCode() {
return 2 * value.hashCode();
}
@Override
public R accept(Visitor visitor) {
return visitor.visit(this);
}
}
public static final class List extends hydra.langs.cypher.openCypher.Literal implements Serializable {
public final java.util.List value;
public List (java.util.List value) {
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof List)) {
return false;
}
List o = (List) (other);
return value.equals(o.value);
}
@Override
public int hashCode() {
return 2 * value.hashCode();
}
@Override
public R accept(Visitor visitor) {
return visitor.visit(this);
}
}
public static final class Map extends hydra.langs.cypher.openCypher.Literal implements Serializable {
public final hydra.langs.cypher.openCypher.MapLiteral value;
public Map (hydra.langs.cypher.openCypher.MapLiteral value) {
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Map)) {
return false;
}
Map o = (Map) (other);
return value.equals(o.value);
}
@Override
public int hashCode() {
return 2 * value.hashCode();
}
@Override
public R accept(Visitor visitor) {
return visitor.visit(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy