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

hydra.langs.java.syntax.ArrayAccess_Variant Maven / Gradle / Ivy

package hydra.langs.java.syntax;

import java.io.Serializable;

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