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

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

There is a newer version: 28.2.0
Show newest version
// Generated by delombok at Thu Oct 07 18:42:34 EDT 2021
// File generated from our OpenAPI spec
package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import com.stripe.net.ApiResource;

public class OrderItem extends StripeObject {
  /**
   * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1,
   * Japanese Yen being a zero-decimal currency) representing the total amount for the line item.
   */
  @SerializedName("amount")
  Long amount;
  /**
   * Three-letter ISO currency code,
   * in lowercase. Must be a supported currency.
   */
  @SerializedName("currency")
  String currency;
  /**
   * Description of the line item, meant to be displayable to the user (e.g., {@code "Express
   * shipping"}).
   */
  @SerializedName("description")
  String description;
  /**
   * String representing the object's type. Objects of the same type share the same value.
   *
   * 

Equal to {@code order_item}. */ @SerializedName("object") String object; /** * The ID of the associated object for this line item. Expandable if not null (e.g., expandable to * a SKU). */ @SerializedName("parent") ExpandableField parent; /** * A positive integer representing the number of instances of {@code parent} that are included in * this order item. Applicable/present only if {@code type} is {@code sku}. */ @SerializedName("quantity") Long quantity; /** * The type of line item. One of {@code sku}, {@code tax}, {@code shipping}, or {@code discount}. */ @SerializedName("type") String type; /** * Get ID of expandable {@code parent} object. */ public String getParent() { return (this.parent != null) ? this.parent.getId() : null; } public void setParent(String id) { this.parent = ApiResource.setExpandableFieldId(id, this.parent); } /** * Get expanded {@code parent}. */ public Sku getParentObject() { return (this.parent != null) ? this.parent.getExpanded() : null; } public void setParentObject(Sku expandableObject) { this.parent = new ExpandableField(expandableObject.getId(), expandableObject); } /** * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, * Japanese Yen being a zero-decimal currency) representing the total amount for the line item. */ @java.lang.SuppressWarnings("all") @lombok.Generated public Long getAmount() { return this.amount; } /** * Three-letter ISO currency code, * in lowercase. Must be a supported currency. */ @java.lang.SuppressWarnings("all") @lombok.Generated public String getCurrency() { return this.currency; } /** * Description of the line item, meant to be displayable to the user (e.g., {@code "Express * shipping"}). */ @java.lang.SuppressWarnings("all") @lombok.Generated public String getDescription() { return this.description; } /** * String representing the object's type. Objects of the same type share the same value. * *

Equal to {@code order_item}. */ @java.lang.SuppressWarnings("all") @lombok.Generated public String getObject() { return this.object; } /** * A positive integer representing the number of instances of {@code parent} that are included in * this order item. Applicable/present only if {@code type} is {@code sku}. */ @java.lang.SuppressWarnings("all") @lombok.Generated public Long getQuantity() { return this.quantity; } /** * The type of line item. One of {@code sku}, {@code tax}, {@code shipping}, or {@code discount}. */ @java.lang.SuppressWarnings("all") @lombok.Generated public String getType() { return this.type; } /** * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, * Japanese Yen being a zero-decimal currency) representing the total amount for the line item. */ @java.lang.SuppressWarnings("all") @lombok.Generated public void setAmount(final Long amount) { this.amount = amount; } /** * Three-letter ISO currency code, * in lowercase. Must be a supported currency. */ @java.lang.SuppressWarnings("all") @lombok.Generated public void setCurrency(final String currency) { this.currency = currency; } /** * Description of the line item, meant to be displayable to the user (e.g., {@code "Express * shipping"}). */ @java.lang.SuppressWarnings("all") @lombok.Generated public void setDescription(final String description) { this.description = description; } /** * String representing the object's type. Objects of the same type share the same value. * *

Equal to {@code order_item}. */ @java.lang.SuppressWarnings("all") @lombok.Generated public void setObject(final String object) { this.object = object; } /** * A positive integer representing the number of instances of {@code parent} that are included in * this order item. Applicable/present only if {@code type} is {@code sku}. */ @java.lang.SuppressWarnings("all") @lombok.Generated public void setQuantity(final Long quantity) { this.quantity = quantity; } /** * The type of line item. One of {@code sku}, {@code tax}, {@code shipping}, or {@code discount}. */ @java.lang.SuppressWarnings("all") @lombok.Generated public void setType(final String type) { this.type = type; } @java.lang.Override @java.lang.SuppressWarnings("all") @lombok.Generated public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof OrderItem)) return false; final OrderItem other = (OrderItem) o; if (!other.canEqual((java.lang.Object) this)) return false; final java.lang.Object this$amount = this.getAmount(); final java.lang.Object other$amount = other.getAmount(); if (this$amount == null ? other$amount != null : !this$amount.equals(other$amount)) return false; final java.lang.Object this$quantity = this.getQuantity(); final java.lang.Object other$quantity = other.getQuantity(); if (this$quantity == null ? other$quantity != null : !this$quantity.equals(other$quantity)) return false; final java.lang.Object this$currency = this.getCurrency(); final java.lang.Object other$currency = other.getCurrency(); if (this$currency == null ? other$currency != null : !this$currency.equals(other$currency)) return false; final java.lang.Object this$description = this.getDescription(); final java.lang.Object other$description = other.getDescription(); if (this$description == null ? other$description != null : !this$description.equals(other$description)) return false; final java.lang.Object this$object = this.getObject(); final java.lang.Object other$object = other.getObject(); if (this$object == null ? other$object != null : !this$object.equals(other$object)) return false; final java.lang.Object this$parent = this.getParent(); final java.lang.Object other$parent = other.getParent(); if (this$parent == null ? other$parent != null : !this$parent.equals(other$parent)) return false; final java.lang.Object this$type = this.getType(); final java.lang.Object other$type = other.getType(); if (this$type == null ? other$type != null : !this$type.equals(other$type)) return false; return true; } @java.lang.SuppressWarnings("all") @lombok.Generated protected boolean canEqual(final java.lang.Object other) { return other instanceof OrderItem; } @java.lang.Override @java.lang.SuppressWarnings("all") @lombok.Generated public int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $amount = this.getAmount(); result = result * PRIME + ($amount == null ? 43 : $amount.hashCode()); final java.lang.Object $quantity = this.getQuantity(); result = result * PRIME + ($quantity == null ? 43 : $quantity.hashCode()); final java.lang.Object $currency = this.getCurrency(); result = result * PRIME + ($currency == null ? 43 : $currency.hashCode()); final java.lang.Object $description = this.getDescription(); result = result * PRIME + ($description == null ? 43 : $description.hashCode()); final java.lang.Object $object = this.getObject(); result = result * PRIME + ($object == null ? 43 : $object.hashCode()); final java.lang.Object $parent = this.getParent(); result = result * PRIME + ($parent == null ? 43 : $parent.hashCode()); final java.lang.Object $type = this.getType(); result = result * PRIME + ($type == null ? 43 : $type.hashCode()); return result; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy