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

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

package hydra.langs.cypher.openCypher;

import java.io.Serializable;

public class ProjectionItem implements Serializable {
  public static final hydra.core.Name NAME = new hydra.core.Name("hydra/langs/cypher/openCypher.ProjectionItem");
  
  public final hydra.langs.cypher.openCypher.Expression expression;
  
  public final java.util.Optional alias;
  
  public ProjectionItem (hydra.langs.cypher.openCypher.Expression expression, java.util.Optional alias) {
    this.expression = expression;
    this.alias = alias;
  }
  
  @Override
  public boolean equals(Object other) {
    if (!(other instanceof ProjectionItem)) {
      return false;
    }
    ProjectionItem o = (ProjectionItem) (other);
    return expression.equals(o.expression) && alias.equals(o.alias);
  }
  
  @Override
  public int hashCode() {
    return 2 * expression.hashCode() + 3 * alias.hashCode();
  }
  
  public ProjectionItem withExpression(hydra.langs.cypher.openCypher.Expression expression) {
    return new ProjectionItem(expression, alias);
  }
  
  public ProjectionItem withAlias(java.util.Optional alias) {
    return new ProjectionItem(expression, alias);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy