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