hydra.langs.java.syntax.AssertStatement Maven / Gradle / Ivy
package hydra.langs.java.syntax;
import java.io.Serializable;
public abstract class AssertStatement implements Serializable {
public static final hydra.core.Name NAME = new hydra.core.Name("hydra/langs/java/syntax.AssertStatement");
private AssertStatement () {
}
public abstract R accept(Visitor visitor) ;
public interface Visitor {
R visit(Single instance) ;
R visit(Pair instance) ;
}
public interface PartialVisitor extends Visitor {
default R otherwise(AssertStatement instance) {
throw new IllegalStateException("Non-exhaustive patterns when matching: " + (instance));
}
default R visit(Single instance) {
return otherwise((instance));
}
default R visit(Pair instance) {
return otherwise((instance));
}
}
public static final class Single extends hydra.langs.java.syntax.AssertStatement implements Serializable {
public final hydra.langs.java.syntax.Expression value;
public Single (hydra.langs.java.syntax.Expression value) {
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Single)) {
return false;
}
Single o = (Single) (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 Pair extends hydra.langs.java.syntax.AssertStatement implements Serializable {
public final hydra.langs.java.syntax.AssertStatement_Pair value;
public Pair (hydra.langs.java.syntax.AssertStatement_Pair value) {
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Pair)) {
return false;
}
Pair o = (Pair) (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