hydra.ext.io.shex.syntax.StringFacet 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.io.shex.syntax;
import java.io.Serializable;
public abstract class StringFacet implements Serializable {
public static final hydra.core.Name TYPE_NAME = new hydra.core.Name("hydra/ext/io/shex/syntax.StringFacet");
public static final hydra.core.Name FIELD_NAME_SEQUENCE = new hydra.core.Name("sequence");
public static final hydra.core.Name FIELD_NAME_REGEXP = new hydra.core.Name("regexp");
private StringFacet () {
}
public abstract R accept(Visitor visitor) ;
public interface Visitor {
R visit(Sequence instance) ;
R visit(Regexp instance) ;
}
public interface PartialVisitor extends Visitor {
default R otherwise(StringFacet instance) {
throw new IllegalStateException("Non-exhaustive patterns when matching: " + (instance));
}
default R visit(Sequence instance) {
return otherwise((instance));
}
default R visit(Regexp instance) {
return otherwise((instance));
}
}
public static final class Sequence extends hydra.ext.io.shex.syntax.StringFacet implements Serializable {
public final hydra.ext.io.shex.syntax.StringFacet_Sequence value;
public Sequence (hydra.ext.io.shex.syntax.StringFacet_Sequence value) {
java.util.Objects.requireNonNull((value));
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Sequence)) {
return false;
}
Sequence o = (Sequence) (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 Regexp extends hydra.ext.io.shex.syntax.StringFacet implements Serializable {
public final hydra.ext.io.shex.syntax.Regexp value;
public Regexp (hydra.ext.io.shex.syntax.Regexp value) {
java.util.Objects.requireNonNull((value));
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Regexp)) {
return false;
}
Regexp o = (Regexp) (other);
return value.equals(o.value);
}
@Override
public int hashCode() {
return 2 * value.hashCode();
}
@Override
public R accept(Visitor visitor) {
return visitor.visit(this);
}
}
}