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

com.stripe.net.StripeHeaders Maven / Gradle / Ivy

package com.stripe.net;

import java.util.List;
import java.util.Map;

public class StripeHeaders {

  Map> headers;

  public StripeHeaders(Map> headers) {
    this.headers = headers;
  }

  /**
   * Returns the first header value for a given key.
   * @param name The name of the header key
   * @return the first value for the given key
   */
  public String get(String name) {
    List valuesList = values(name);
    String value = null;
    if (valuesList != null && valuesList.size() > 0) {
      value = valuesList.get(0);
    }
    return value;
  }

  public List values(String name) {
    return headers == null ? null : headers.get(name);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy