All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hydra.langs.shex.syntax.UnaryTripleExpr Maven / Gradle / Ivy

package hydra.langs.shex.syntax;

import java.io.Serializable;

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