hydra.ext.org.w3.owl.syntax.Individual 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.org.w3.owl.syntax;
import java.io.Serializable;
public abstract class Individual implements Serializable {
public static final hydra.core.Name TYPE_NAME = new hydra.core.Name("hydra/ext/org/w3/owl/syntax.Individual");
public static final hydra.core.Name FIELD_NAME_NAMED = new hydra.core.Name("named");
public static final hydra.core.Name FIELD_NAME_ANONYMOUS = new hydra.core.Name("anonymous");
private Individual () {
}
public abstract R accept(Visitor visitor) ;
public interface Visitor {
R visit(Named instance) ;
R visit(Anonymous instance) ;
}
public interface PartialVisitor extends Visitor {
default R otherwise(Individual instance) {
throw new IllegalStateException("Non-exhaustive patterns when matching: " + (instance));
}
default R visit(Named instance) {
return otherwise((instance));
}
default R visit(Anonymous instance) {
return otherwise((instance));
}
}
public static final class Named extends hydra.ext.org.w3.owl.syntax.Individual implements Serializable {
public final hydra.ext.org.w3.owl.syntax.NamedIndividual value;
public Named (hydra.ext.org.w3.owl.syntax.NamedIndividual value) {
java.util.Objects.requireNonNull((value));
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Named)) {
return false;
}
Named o = (Named) (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 Anonymous extends hydra.ext.org.w3.owl.syntax.Individual implements Serializable {
public final hydra.ext.org.w3.owl.syntax.AnonymousIndividual value;
public Anonymous (hydra.ext.org.w3.owl.syntax.AnonymousIndividual value) {
java.util.Objects.requireNonNull((value));
this.value = value;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Anonymous)) {
return false;
}
Anonymous o = (Anonymous) (other);
return value.equals(o.value);
}
@Override
public int hashCode() {
return 2 * value.hashCode();
}
@Override
public R accept(Visitor visitor) {
return visitor.visit(this);
}
}
}