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

com.stripe.model.StripeActiveObject Maven / Gradle / Ivy

There is a newer version: 28.1.0-beta.3
Show newest version
package com.stripe.model;

import com.stripe.net.StripeResponseGetter;

/**
 * Represents a {@code StripeObject} that has properties or method that can make HTTP requests.
 * Examples: - list that can retrieve next page - event that can fetch associated object
 */
public interface StripeActiveObject {
  /**
   * Method is used by the containing object or {@code StripeResponseGetter} implementations to set
   * the {@code StripeResponseGetter} instance used to make further requests.
   *
   * @param responseGetter the {@code StripeResponseGetter} instance to use for making further
   *     requests.
   */
  void setResponseGetter(StripeResponseGetter responseGetter);

  /**
   * Calls {@code setResponseGetter} on the {@code object} if it's supported.
   *
   * @param object the object to set the {@code StripeResponseGetter} for.
   * @param responseGetter the {@code StripeResponseGetter} instance to use for making further
   *     requests.
   */
  default void trySetResponseGetter(Object object, StripeResponseGetter responseGetter) {
    if (object instanceof StripeActiveObject) {
      ((StripeActiveObject) object).setResponseGetter(responseGetter);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy