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

org.molgenis.api.data.v3.AutoValue_EntityCollection Maven / Gradle / Ivy

There is a newer version: 8.4.5
Show newest version

package org.molgenis.api.data.v3;

import java.util.List;
import javax.annotation.CheckForNull;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.molgenis.data.Entity;

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

  private final String entityTypeId;
  private final List entities;
  private final EntityCollection.Page page;
  private final String entityId;

  private AutoValue_EntityCollection(
      String entityTypeId,
      List entities,
      @Nullable EntityCollection.Page page,
      @Nullable String entityId) {
    this.entityTypeId = entityTypeId;
    this.entities = entities;
    this.page = page;
    this.entityId = entityId;
  }

  @Override
  String getEntityTypeId() {
    return entityTypeId;
  }

  @Override
  List getEntities() {
    return entities;
  }

  @Nullable
  @CheckForNull
  @Override
  EntityCollection.Page getPage() {
    return page;
  }

  @Nullable
  @CheckForNull
  @Override
  String getEntityId() {
    return entityId;
  }

  @Override
  public String toString() {
    return "EntityCollection{"
        + "entityTypeId=" + entityTypeId + ", "
        + "entities=" + entities + ", "
        + "page=" + page + ", "
        + "entityId=" + entityId
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof EntityCollection) {
      EntityCollection that = (EntityCollection) o;
      return (this.entityTypeId.equals(that.getEntityTypeId()))
           && (this.entities.equals(that.getEntities()))
           && ((this.page == null) ? (that.getPage() == null) : this.page.equals(that.getPage()))
           && ((this.entityId == null) ? (that.getEntityId() == null) : this.entityId.equals(that.getEntityId()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.entityTypeId.hashCode();
    h *= 1000003;
    h ^= this.entities.hashCode();
    h *= 1000003;
    h ^= (page == null) ? 0 : this.page.hashCode();
    h *= 1000003;
    h ^= (entityId == null) ? 0 : this.entityId.hashCode();
    return h;
  }

  static final class Builder extends EntityCollection.Builder {
    private String entityTypeId;
    private List entities;
    private EntityCollection.Page page;
    private String entityId;
    Builder() {
    }
    @Override
    EntityCollection.Builder setEntityTypeId(String entityTypeId) {
      if (entityTypeId == null) {
        throw new NullPointerException("Null entityTypeId");
      }
      this.entityTypeId = entityTypeId;
      return this;
    }
    @Override
    EntityCollection.Builder setEntities(List entities) {
      if (entities == null) {
        throw new NullPointerException("Null entities");
      }
      this.entities = entities;
      return this;
    }
    @Override
    EntityCollection.Builder setPage(@Nullable EntityCollection.Page page) {
      this.page = page;
      return this;
    }
    @Override
    EntityCollection.Builder setEntityId(@Nullable String entityId) {
      this.entityId = entityId;
      return this;
    }
    @Override
    EntityCollection build() {
      String missing = "";
      if (this.entityTypeId == null) {
        missing += " entityTypeId";
      }
      if (this.entities == null) {
        missing += " entities";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_EntityCollection(
          this.entityTypeId,
          this.entities,
          this.page,
          this.entityId);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy