hydra.ext.fr.inria.coq.syntax.Binder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hydra-ext Show documentation
Show all versions of hydra-ext Show documentation
Hydra language extensions in Java; models, coders, and utilities
The newest version!
// Note: this is an automatically generated file. Do not edit.
package hydra.ext.fr.inria.coq.syntax;
import java.io.Serializable;
public abstract class Binder implements Serializable {
public static final hydra.core.Name TYPE_NAME = new hydra.core.Name("hydra/ext/fr/inria/coq/syntax.Binder");
public static final hydra.core.Name FIELD_NAME_NAME = new hydra.core.Name("name");
public static final hydra.core.Name FIELD_NAME_TYPE = new hydra.core.Name("type");
public static final hydra.core.Name FIELD_NAME_TERM = new hydra.core.Name("term");
public static final hydra.core.Name FIELD_NAME_IMPLICIT = new hydra.core.Name("implicit");
public static final hydra.core.Name FIELD_NAME_GENERALIZING = new hydra.core.Name("generalizing");
public static final hydra.core.Name FIELD_NAME_PATTERN = new hydra.core.Name("pattern");
private Binder () {
}
public abstract R accept(Visitor visitor) ;
public interface Visitor {
R visit(Name instance) ;
R visit(Type instance) ;
R visit(Term instance) ;
R visit(Implicit instance) ;
R visit(Generalizing instance) ;
R visit(Pattern instance) ;
}
public interface PartialVisitor extends Visitor {
default R otherwise(Binder instance) {
throw new IllegalStateException("Non-exhaustive patterns when matching: " + (instance));
}
default R visit(Name instance) {
return otherwise((instance));
}
default R visit(Type instance) {
return otherwise((instance));
}
default R visit(Term instance) {
return otherwise((instance));
}
default R visit(Implicit instance) {
return otherwise((instance));
}
default R visit(Generalizing instance) {
return otherwise((instance));
}
default R visit(Pattern instance) {
return otherwise((instance));
}
}
public static final class Name extends hydra.ext.fr.inria.coq.syntax.Binder implements Serializable {
public final hydra.ext.fr.inria.coq.syntax.Name value;
public Name (hydra.ext.fr.inria.coq.syntax.Name value) {
java.util.Objects.requireNonNull((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 Type extends hydra.ext.fr.inria.coq.syntax.Binder implements Serializable {
public final hydra.ext.fr.inria.coq.syntax.TypeBinders value;
public Type (hydra.ext.fr.inria.coq.syntax.TypeBinders value) {
java.util.Objects.requireNonNull((value));
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Type)) {
return false;
}
Type o = (Type) (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 Term extends hydra.ext.fr.inria.coq.syntax.Binder implements Serializable {
public final hydra.ext.fr.inria.coq.syntax.LetBinder value;
public Term (hydra.ext.fr.inria.coq.syntax.LetBinder value) {
java.util.Objects.requireNonNull((value));
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Term)) {
return false;
}
Term o = (Term) (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 Implicit extends hydra.ext.fr.inria.coq.syntax.Binder implements Serializable {
public final hydra.ext.fr.inria.coq.syntax.ImplicitBinders value;
public Implicit (hydra.ext.fr.inria.coq.syntax.ImplicitBinders value) {
java.util.Objects.requireNonNull((value));
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Implicit)) {
return false;
}
Implicit o = (Implicit) (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 Generalizing extends hydra.ext.fr.inria.coq.syntax.Binder implements Serializable {
public final hydra.ext.fr.inria.coq.syntax.GeneralizingBinder value;
public Generalizing (hydra.ext.fr.inria.coq.syntax.GeneralizingBinder value) {
java.util.Objects.requireNonNull((value));
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Generalizing)) {
return false;
}
Generalizing o = (Generalizing) (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 Pattern extends hydra.ext.fr.inria.coq.syntax.Binder implements Serializable {
public final hydra.ext.fr.inria.coq.syntax.Pattern0 value;
public Pattern (hydra.ext.fr.inria.coq.syntax.Pattern0 value) {
java.util.Objects.requireNonNull((value));
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Pattern)) {
return false;
}
Pattern o = (Pattern) (other);
return value.equals(o.value);
}
@Override
public int hashCode() {
return 2 * value.hashCode();
}
@Override
public R accept(Visitor visitor) {
return visitor.visit(this);
}
}
}