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

io.getstream.core.models.Paginated Maven / Gradle / Ivy

There is a newer version: 3.15.0
Show newest version
package io.getstream.core.models;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
import java.util.List;
import java.util.Objects;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Paginated {

  private final String next;
  private List results;
  private final String duration;

  public String getNext() {
    return next;
  }

  public List getResults() {
    return results;
  }

  public void setResults(List results) {
    this.results = results;
  }

  public String getDuration() {
    return duration;
  }

  @JsonCreator
  public Paginated(
      @JsonProperty("next") String next,
      @JsonProperty("results") List results,
      @JsonProperty("duration") String duration) {
    this.next = next;
    this.results = results;
    this.duration = duration;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Paginated that = (Paginated) o;
    return next.equals(that.next) && duration.equals(that.duration);
  }

  @Override
  public int hashCode() {
    return Objects.hash(super.hashCode(), next, duration);
  }

  @Override
  public String toString() {
    return MoreObjects.toStringHelper(this)
        .add("next", this.next)
        .add("results", this.results)
        .add("duration", this.duration)
        .toString();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy