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

com.github.rinde.rinsim.geom.AutoValue_Connection Maven / Gradle / Ivy

The newest version!

package com.github.rinde.rinsim.geom;

import com.google.common.base.Optional;
import javax.annotation.Generated;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
 final class AutoValue_Connection extends Connection {

  private final Point from;
  private final Point to;
  private final Optional data;

  AutoValue_Connection(
      Point from,
      Point to,
      Optional data) {
    if (from == null) {
      throw new NullPointerException("Null from");
    }
    this.from = from;
    if (to == null) {
      throw new NullPointerException("Null to");
    }
    this.to = to;
    if (data == null) {
      throw new NullPointerException("Null data");
    }
    this.data = data;
  }

  @Override
  public Point from() {
    return from;
  }

  @Override
  public Point to() {
    return to;
  }

  @Override
  public Optional data() {
    return data;
  }

  @Override
  public String toString() {
    return "Connection{"
        + "from=" + from + ", "
        + "to=" + to + ", "
        + "data=" + data
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Connection) {
      Connection that = (Connection) o;
      return (this.from.equals(that.from()))
           && (this.to.equals(that.to()))
           && (this.data.equals(that.data()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.from.hashCode();
    h *= 1000003;
    h ^= this.to.hashCode();
    h *= 1000003;
    h ^= this.data.hashCode();
    return h;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy