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