hydra.langs.graphql.syntax.Alias Maven / Gradle / Ivy
package hydra.langs.graphql.syntax;
import java.io.Serializable;
public abstract class Alias implements Serializable {
public static final hydra.core.Name NAME = new hydra.core.Name("hydra/langs/graphql/syntax.Alias");
private Alias () {
}
public abstract R accept(Visitor visitor) ;
public interface Visitor {
R visit(Name instance) ;
R visit(Colon instance) ;
}
public interface PartialVisitor extends Visitor {
default R otherwise(Alias instance) {
throw new IllegalStateException("Non-exhaustive patterns when matching: " + (instance));
}
default R visit(Name instance) {
return otherwise((instance));
}
default R visit(Colon instance) {
return otherwise((instance));
}
}
public static final class Name extends hydra.langs.graphql.syntax.Alias implements Serializable {
public final hydra.langs.graphql.syntax.Name value;
public Name (hydra.langs.graphql.syntax.Name value) {
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Name)) {
return false;
}
Name o = (Name) (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 Colon extends hydra.langs.graphql.syntax.Alias implements Serializable {
public Colon () {
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Colon)) {
return false;
}
Colon o = (Colon) (other);
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public R accept(Visitor visitor) {
return visitor.visit(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy