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

org.molgenis.api.files.v1.AutoValue_FileResponse Maven / Gradle / Ivy

The newest version!
package org.molgenis.api.files.v1;

import javax.annotation.Nullable;
import javax.annotation.processing.Generated;

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

  private final String id;

  private final String filename;

  private final String contentType;

  private final Long size;

  private AutoValue_FileResponse(
      String id,
      String filename,
      @Nullable String contentType,
      @Nullable Long size) {
    this.id = id;
    this.filename = filename;
    this.contentType = contentType;
    this.size = size;
  }

  @Override
  public String getId() {
    return id;
  }

  @Override
  public String getFilename() {
    return filename;
  }

  @Nullable
  @Override
  public String getContentType() {
    return contentType;
  }

  @Nullable
  @Override
  public Long getSize() {
    return size;
  }

  @Override
  public String toString() {
    return "FileResponse{"
         + "id=" + id + ", "
         + "filename=" + filename + ", "
         + "contentType=" + contentType + ", "
         + "size=" + size
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof FileResponse) {
      FileResponse that = (FileResponse) o;
      return this.id.equals(that.getId())
          && this.filename.equals(that.getFilename())
          && (this.contentType == null ? that.getContentType() == null : this.contentType.equals(that.getContentType()))
          && (this.size == null ? that.getSize() == null : this.size.equals(that.getSize()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= id.hashCode();
    h$ *= 1000003;
    h$ ^= filename.hashCode();
    h$ *= 1000003;
    h$ ^= (contentType == null) ? 0 : contentType.hashCode();
    h$ *= 1000003;
    h$ ^= (size == null) ? 0 : size.hashCode();
    return h$;
  }

  static final class Builder extends FileResponse.Builder {
    private String id;
    private String filename;
    private String contentType;
    private Long size;
    Builder() {
    }
    @Override
    public FileResponse.Builder setId(String id) {
      if (id == null) {
        throw new NullPointerException("Null id");
      }
      this.id = id;
      return this;
    }
    @Override
    public FileResponse.Builder setFilename(String filename) {
      if (filename == null) {
        throw new NullPointerException("Null filename");
      }
      this.filename = filename;
      return this;
    }
    @Override
    public FileResponse.Builder setContentType(String contentType) {
      this.contentType = contentType;
      return this;
    }
    @Override
    public FileResponse.Builder setSize(Long size) {
      this.size = size;
      return this;
    }
    @Override
    public FileResponse build() {
      String missing = "";
      if (this.id == null) {
        missing += " id";
      }
      if (this.filename == null) {
        missing += " filename";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_FileResponse(
          this.id,
          this.filename,
          this.contentType,
          this.size);
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy