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

hydra.langs.cypher.openCypher.ListOperatorExpression Maven / Gradle / Ivy

package hydra.langs.cypher.openCypher;

import java.io.Serializable;

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