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

io.weaviate.client.v1.graphql.query.argument.NearObjectArgument Maven / Gradle / Ivy

There is a newer version: 4.9.0
Show newest version
// Generated by delombok at Thu Dec 07 10:07:46 UTC 2023
package io.weaviate.client.v1.graphql.query.argument;

import java.util.LinkedHashSet;
import java.util.Set;
import io.weaviate.client.v1.graphql.query.util.Serializer;
import org.apache.commons.lang3.StringUtils;

public class NearObjectArgument implements Argument {
  private final String id;
  private final String beacon;
  private final Float certainty;
  private final Float distance;

  @Override
  public String build() {
    Set arg = new LinkedHashSet<>();
    if (StringUtils.isNotBlank(id)) {
      arg.add(String.format("id:%s", Serializer.quote(id)));
    }
    if (StringUtils.isNotBlank(beacon)) {
      arg.add(String.format("beacon:%s", Serializer.quote(beacon)));
    }
    if (certainty != null) {
      arg.add(String.format("certainty:%s", certainty));
    }
    if (distance != null) {
      arg.add(String.format("distance:%s", distance));
    }
    return String.format("nearObject:{%s}", String.join(" ", arg));
  }

  @java.lang.SuppressWarnings("all")
  NearObjectArgument(final String id, final String beacon, final Float certainty, final Float distance) {
    this.id = id;
    this.beacon = beacon;
    this.certainty = certainty;
    this.distance = distance;
  }


  @java.lang.SuppressWarnings("all")
  public static class NearObjectArgumentBuilder {
    @java.lang.SuppressWarnings("all")
    private String id;
    @java.lang.SuppressWarnings("all")
    private String beacon;
    @java.lang.SuppressWarnings("all")
    private Float certainty;
    @java.lang.SuppressWarnings("all")
    private Float distance;

    @java.lang.SuppressWarnings("all")
    NearObjectArgumentBuilder() {
    }

    /**
     * @return {@code this}.
     */
    @java.lang.SuppressWarnings("all")
    public NearObjectArgument.NearObjectArgumentBuilder id(final String id) {
      this.id = id;
      return this;
    }

    /**
     * @return {@code this}.
     */
    @java.lang.SuppressWarnings("all")
    public NearObjectArgument.NearObjectArgumentBuilder beacon(final String beacon) {
      this.beacon = beacon;
      return this;
    }

    /**
     * @return {@code this}.
     */
    @java.lang.SuppressWarnings("all")
    public NearObjectArgument.NearObjectArgumentBuilder certainty(final Float certainty) {
      this.certainty = certainty;
      return this;
    }

    /**
     * @return {@code this}.
     */
    @java.lang.SuppressWarnings("all")
    public NearObjectArgument.NearObjectArgumentBuilder distance(final Float distance) {
      this.distance = distance;
      return this;
    }

    @java.lang.SuppressWarnings("all")
    public NearObjectArgument build() {
      return new NearObjectArgument(this.id, this.beacon, this.certainty, this.distance);
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    public java.lang.String toString() {
      return "NearObjectArgument.NearObjectArgumentBuilder(id=" + this.id + ", beacon=" + this.beacon + ", certainty=" + this.certainty + ", distance=" + this.distance + ")";
    }
  }

  @java.lang.SuppressWarnings("all")
  public static NearObjectArgument.NearObjectArgumentBuilder builder() {
    return new NearObjectArgument.NearObjectArgumentBuilder();
  }

  @java.lang.SuppressWarnings("all")
  public String getId() {
    return this.id;
  }

  @java.lang.SuppressWarnings("all")
  public String getBeacon() {
    return this.beacon;
  }

  @java.lang.SuppressWarnings("all")
  public Float getCertainty() {
    return this.certainty;
  }

  @java.lang.SuppressWarnings("all")
  public Float getDistance() {
    return this.distance;
  }

  @java.lang.Override
  @java.lang.SuppressWarnings("all")
  public java.lang.String toString() {
    return "NearObjectArgument(id=" + this.getId() + ", beacon=" + this.getBeacon() + ", certainty=" + this.getCertainty() + ", distance=" + this.getDistance() + ")";
  }

  @java.lang.Override
  @java.lang.SuppressWarnings("all")
  public boolean equals(final java.lang.Object o) {
    if (o == this) return true;
    if (!(o instanceof NearObjectArgument)) return false;
    final NearObjectArgument other = (NearObjectArgument) o;
    if (!other.canEqual((java.lang.Object) this)) return false;
    final java.lang.Object this$certainty = this.getCertainty();
    final java.lang.Object other$certainty = other.getCertainty();
    if (this$certainty == null ? other$certainty != null : !this$certainty.equals(other$certainty)) return false;
    final java.lang.Object this$distance = this.getDistance();
    final java.lang.Object other$distance = other.getDistance();
    if (this$distance == null ? other$distance != null : !this$distance.equals(other$distance)) return false;
    final java.lang.Object this$id = this.getId();
    final java.lang.Object other$id = other.getId();
    if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
    final java.lang.Object this$beacon = this.getBeacon();
    final java.lang.Object other$beacon = other.getBeacon();
    if (this$beacon == null ? other$beacon != null : !this$beacon.equals(other$beacon)) return false;
    return true;
  }

  @java.lang.SuppressWarnings("all")
  protected boolean canEqual(final java.lang.Object other) {
    return other instanceof NearObjectArgument;
  }

  @java.lang.Override
  @java.lang.SuppressWarnings("all")
  public int hashCode() {
    final int PRIME = 59;
    int result = 1;
    final java.lang.Object $certainty = this.getCertainty();
    result = result * PRIME + ($certainty == null ? 43 : $certainty.hashCode());
    final java.lang.Object $distance = this.getDistance();
    result = result * PRIME + ($distance == null ? 43 : $distance.hashCode());
    final java.lang.Object $id = this.getId();
    result = result * PRIME + ($id == null ? 43 : $id.hashCode());
    final java.lang.Object $beacon = this.getBeacon();
    result = result * PRIME + ($beacon == null ? 43 : $beacon.hashCode());
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy