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

hydra.graph.Comparison Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
// Note: this is an automatically generated file. Do not edit.

package hydra.graph;

import java.io.Serializable;

/**
 * An equality judgement: less than, equal to, or greater than
 */
public abstract class Comparison implements Serializable {
  public static final hydra.core.Name TYPE_NAME = new hydra.core.Name("hydra/graph.Comparison");
  
  public static final hydra.core.Name FIELD_NAME_LESS_THAN = new hydra.core.Name("lessThan");
  
  public static final hydra.core.Name FIELD_NAME_EQUAL_TO = new hydra.core.Name("equalTo");
  
  public static final hydra.core.Name FIELD_NAME_GREATER_THAN = new hydra.core.Name("greaterThan");
  
  private Comparison () {
  
  }
  
  public abstract  R accept(Visitor visitor) ;
  
  public interface Visitor {
    R visit(LessThan instance) ;
    
    R visit(EqualTo instance) ;
    
    R visit(GreaterThan instance) ;
  }
  
  public interface PartialVisitor extends Visitor {
    default R otherwise(Comparison instance) {
      throw new IllegalStateException("Non-exhaustive patterns when matching: " + (instance));
    }
    
    default R visit(LessThan instance) {
      return otherwise((instance));
    }
    
    default R visit(EqualTo instance) {
      return otherwise((instance));
    }
    
    default R visit(GreaterThan instance) {
      return otherwise((instance));
    }
  }
  
  public static final class LessThan extends hydra.graph.Comparison implements Serializable {
    public LessThan () {
    
    }
    
    @Override
    public boolean equals(Object other) {
      if (!(other instanceof LessThan)) {
        return false;
      }
      LessThan o = (LessThan) (other);
      return true;
    }
    
    @Override
    public int hashCode() {
      return 0;
    }
    
    @Override
    public  R accept(Visitor visitor) {
      return visitor.visit(this);
    }
  }
  
  public static final class EqualTo extends hydra.graph.Comparison implements Serializable {
    public EqualTo () {
    
    }
    
    @Override
    public boolean equals(Object other) {
      if (!(other instanceof EqualTo)) {
        return false;
      }
      EqualTo o = (EqualTo) (other);
      return true;
    }
    
    @Override
    public int hashCode() {
      return 0;
    }
    
    @Override
    public  R accept(Visitor visitor) {
      return visitor.visit(this);
    }
  }
  
  public static final class GreaterThan extends hydra.graph.Comparison implements Serializable {
    public GreaterThan () {
    
    }
    
    @Override
    public boolean equals(Object other) {
      if (!(other instanceof GreaterThan)) {
        return false;
      }
      GreaterThan o = (GreaterThan) (other);
      return true;
    }
    
    @Override
    public int hashCode() {
      return 0;
    }
    
    @Override
    public  R accept(Visitor visitor) {
      return visitor.visit(this);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy