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

org.graylog.plugins.views.search.timeranges.AutoValue_OffsetRange Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package org.graylog.plugins.views.search.timeranges;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Optional;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;

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

  private final String source;

  private final Optional id;

  private final String offset;

  private AutoValue_OffsetRange(
      String source,
      Optional id,
      String offset) {
    this.source = source;
    this.id = id;
    this.offset = offset;
  }

  @JsonProperty
  @Override
  public String source() {
    return source;
  }

  @JsonProperty
  @Override
  public Optional id() {
    return id;
  }

  @JsonProperty
  @Override
  public String offset() {
    return offset;
  }

  @Override
  public String toString() {
    return "OffsetRange{"
        + "source=" + source + ", "
        + "id=" + id + ", "
        + "offset=" + offset
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof OffsetRange) {
      OffsetRange that = (OffsetRange) o;
      return this.source.equals(that.source())
          && this.id.equals(that.id())
          && this.offset.equals(that.offset());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= source.hashCode();
    h$ *= 1000003;
    h$ ^= id.hashCode();
    h$ *= 1000003;
    h$ ^= offset.hashCode();
    return h$;
  }

  static final class Builder extends OffsetRange.Builder {
    private String source;
    private Optional id = Optional.empty();
    private String offset;
    Builder() {
    }
    @Override
    public OffsetRange.Builder source(String source) {
      if (source == null) {
        throw new NullPointerException("Null source");
      }
      this.source = source;
      return this;
    }
    @Override
    public OffsetRange.Builder id(@Nullable String id) {
      this.id = Optional.ofNullable(id);
      return this;
    }
    @Override
    public OffsetRange.Builder offset(String offset) {
      if (offset == null) {
        throw new NullPointerException("Null offset");
      }
      this.offset = offset;
      return this;
    }
    @Override
    public OffsetRange build() {
      String missing = "";
      if (this.source == null) {
        missing += " source";
      }
      if (this.offset == null) {
        missing += " offset";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_OffsetRange(
          this.source,
          this.id,
          this.offset);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy