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

com.stripe.model.ExpandableField 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;

// This class is meant to be used for expandable fields in the Stripe API.
// For example, ExpandableField in Charge.
// The class should always contain a String id, and may have a null or type T expandedObject.
// More info here: https://stripe.com/docs/api#expanding_objects
public class ExpandableField implements StripeActiveObject {
  private String id;
  private T expandedObject;

  public ExpandableField(String id, T expandedObject) {
    this.id = id;
    this.expandedObject = expandedObject;
  }

  public boolean isExpanded() {
    return expandedObject != null;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public T getExpanded() {
    return expandedObject;
  }

  public void setExpanded(T expandedObject) {
    this.expandedObject = expandedObject;
  }

  @Override
  public void setResponseGetter(StripeResponseGetter responseGetter) {
    trySetResponseGetter(expandedObject, responseGetter);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy