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

org.knowm.xchange.coinbasepro.dto.CoinbasePagedResponse Maven / Gradle / Ivy

The newest version!
package org.knowm.xchange.coinbasepro.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import si.mazi.rescu.HttpResponseAware;

public class CoinbasePagedResponse extends ArrayList implements HttpResponseAware {

  @JsonIgnore private Map> headers;

  @Override
  public void setResponseHeaders(Map> headers) {
    this.headers = headers;
  }

  @Override
  public Map> getResponseHeaders() {
    return headers;
  }

  public String getBefore() {
    return headers.getOrDefault("Cb-Before", Collections.emptyList()).stream()
        .findFirst()
        .orElse(null);
  }

  public String getAfter() {
    return headers.getOrDefault("Cb-After", Collections.emptyList()).stream()
        .findFirst()
        .orElse(null);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy