public static class Storefront.ProductVariant extends AbstractResponse<Storefront.ProductVariant> implements Storefront.HasMetafields, Storefront.Merchandise, Storefront.MetafieldParentResource, Storefront.MetafieldReference, Storefront.Node
optimisticData, responseData| Constructor and Description |
|---|
ProductVariant() |
ProductVariant(JsonObject fields) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Boolean |
getAvailableForSale()
Indicates if the product variant is available for sale.
|
java.lang.String |
getBarcode()
The barcode (for example, ISBN, UPC, or GTIN) associated with the variant.
|
Storefront.MoneyV2 |
getCompareAtPrice()
The compare at price of the variant.
|
Storefront.MoneyV2 |
getCompareAtPriceV2()
Deprecated.
Use `compareAtPrice` instead.
|
java.lang.Boolean |
getCurrentlyNotInStock()
Whether a product is out of stock but still available for purchase (used for backorders).
|
java.lang.String |
getGraphQlTypeName() |
ID |
getId()
A globally-unique identifier.
|
Storefront.Image |
getImage()
Image associated with the product variant.
|
Storefront.Metafield |
getMetafield()
Returns a metafield found by namespace and key.
|
java.util.List<Storefront.Metafield> |
getMetafields()
The metafields associated with the resource matching the supplied list of namespaces and keys.
|
Storefront.MoneyV2 |
getPrice()
The product variant’s price.
|
Storefront.MoneyV2 |
getPriceV2()
Deprecated.
Use `price` instead.
|
Storefront.Product |
getProduct()
The product object that the product variant belongs to.
|
java.lang.Integer |
getQuantityAvailable()
The total sellable quantity of the variant for online sales channels.
|
java.lang.Boolean |
getRequiresShipping()
Whether a customer needs to provide a shipping address when placing an order for the product
variant.
|
java.util.List<Storefront.SelectedOption> |
getSelectedOptions()
List of product options applied to the variant.
|
Storefront.SellingPlanAllocationConnection |
getSellingPlanAllocations()
Represents an association between a variant and a selling plan.
|
java.lang.String |
getSku()
The SKU (stock keeping unit) associated with the variant.
|
Storefront.StoreAvailabilityConnection |
getStoreAvailability()
The in-store pickup availability of this variant by location.
|
java.lang.String |
getTitle()
The product variant’s title.
|
Storefront.MoneyV2 |
getUnitPrice()
The unit price value for the variant based on the variant's measurement.
|
Storefront.UnitPriceMeasurement |
getUnitPriceMeasurement()
The unit price measurement for the variant.
|
java.lang.Double |
getWeight()
The weight of the product variant in the unit system specified with `weight_unit`.
|
Storefront.WeightUnit |
getWeightUnit()
Unit of measurement for weight.
|
Storefront.ProductVariant |
setAvailableForSale(java.lang.Boolean arg) |
Storefront.ProductVariant |
setBarcode(java.lang.String arg) |
Storefront.ProductVariant |
setCompareAtPrice(Storefront.MoneyV2 arg) |
Storefront.ProductVariant |
setCompareAtPriceV2(Storefront.MoneyV2 arg) |
Storefront.ProductVariant |
setCurrentlyNotInStock(java.lang.Boolean arg) |
Storefront.ProductVariant |
setImage(Storefront.Image arg) |
Storefront.ProductVariant |
setMetafield(Storefront.Metafield arg) |
Storefront.ProductVariant |
setMetafields(java.util.List<Storefront.Metafield> arg) |
Storefront.ProductVariant |
setPrice(Storefront.MoneyV2 arg) |
Storefront.ProductVariant |
setPriceV2(Storefront.MoneyV2 arg) |
Storefront.ProductVariant |
setProduct(Storefront.Product arg) |
Storefront.ProductVariant |
setQuantityAvailable(java.lang.Integer arg) |
Storefront.ProductVariant |
setRequiresShipping(java.lang.Boolean arg) |
Storefront.ProductVariant |
setSelectedOptions(java.util.List<Storefront.SelectedOption> arg) |
Storefront.ProductVariant |
setSellingPlanAllocations(Storefront.SellingPlanAllocationConnection arg) |
Storefront.ProductVariant |
setSku(java.lang.String arg) |
Storefront.ProductVariant |
setStoreAvailability(Storefront.StoreAvailabilityConnection arg) |
Storefront.ProductVariant |
setTitle(java.lang.String arg) |
Storefront.ProductVariant |
setUnitPrice(Storefront.MoneyV2 arg) |
Storefront.ProductVariant |
setUnitPriceMeasurement(Storefront.UnitPriceMeasurement arg) |
Storefront.ProductVariant |
setWeight(java.lang.Double arg) |
Storefront.ProductVariant |
setWeightUnit(Storefront.WeightUnit arg) |
boolean |
unwrapsToObject(java.lang.String key) |
collectNodes, get, getFieldName, getKey, jsonAsArray, jsonAsBoolean, jsonAsDouble, jsonAsInteger, jsonAsObject, jsonAsString, withAliaspublic ProductVariant()
public ProductVariant(JsonObject fields)
throws SchemaViolationError
SchemaViolationErrorpublic java.lang.String getGraphQlTypeName()
getGraphQlTypeName in interface Storefront.HasMetafieldsgetGraphQlTypeName in interface Storefront.MerchandisegetGraphQlTypeName in interface Storefront.MetafieldParentResourcegetGraphQlTypeName in interface Storefront.MetafieldReferencegetGraphQlTypeName in interface Storefront.NodegetGraphQlTypeName in interface Nodepublic java.lang.Boolean getAvailableForSale()
public Storefront.ProductVariant setAvailableForSale(java.lang.Boolean arg)
public java.lang.String getBarcode()
public Storefront.ProductVariant setBarcode(java.lang.String arg)
public Storefront.MoneyV2 getCompareAtPrice()
public Storefront.ProductVariant setCompareAtPrice(Storefront.MoneyV2 arg)
public Storefront.MoneyV2 getCompareAtPriceV2()
public Storefront.ProductVariant setCompareAtPriceV2(Storefront.MoneyV2 arg)
public java.lang.Boolean getCurrentlyNotInStock()
public Storefront.ProductVariant setCurrentlyNotInStock(java.lang.Boolean arg)
public ID getId()
getId in interface Storefront.NodegetId in interface Nodepublic Storefront.Image getImage()
public Storefront.ProductVariant setImage(Storefront.Image arg)
public Storefront.Metafield getMetafield()
getMetafield in interface Storefront.HasMetafieldspublic Storefront.ProductVariant setMetafield(Storefront.Metafield arg)
public java.util.List<Storefront.Metafield> getMetafields()
getMetafields in interface Storefront.HasMetafieldspublic Storefront.ProductVariant setMetafields(java.util.List<Storefront.Metafield> arg)
public Storefront.MoneyV2 getPrice()
public Storefront.ProductVariant setPrice(Storefront.MoneyV2 arg)
public Storefront.MoneyV2 getPriceV2()
public Storefront.ProductVariant setPriceV2(Storefront.MoneyV2 arg)
public Storefront.Product getProduct()
public Storefront.ProductVariant setProduct(Storefront.Product arg)
public java.lang.Integer getQuantityAvailable()
public Storefront.ProductVariant setQuantityAvailable(java.lang.Integer arg)
public java.lang.Boolean getRequiresShipping()
public Storefront.ProductVariant setRequiresShipping(java.lang.Boolean arg)
public java.util.List<Storefront.SelectedOption> getSelectedOptions()
public Storefront.ProductVariant setSelectedOptions(java.util.List<Storefront.SelectedOption> arg)
public Storefront.SellingPlanAllocationConnection getSellingPlanAllocations()
public Storefront.ProductVariant setSellingPlanAllocations(Storefront.SellingPlanAllocationConnection arg)
public java.lang.String getSku()
public Storefront.ProductVariant setSku(java.lang.String arg)
public Storefront.StoreAvailabilityConnection getStoreAvailability()
public Storefront.ProductVariant setStoreAvailability(Storefront.StoreAvailabilityConnection arg)
public java.lang.String getTitle()
public Storefront.ProductVariant setTitle(java.lang.String arg)
public Storefront.MoneyV2 getUnitPrice()
public Storefront.ProductVariant setUnitPrice(Storefront.MoneyV2 arg)
public Storefront.UnitPriceMeasurement getUnitPriceMeasurement()
public Storefront.ProductVariant setUnitPriceMeasurement(Storefront.UnitPriceMeasurement arg)
public java.lang.Double getWeight()
public Storefront.ProductVariant setWeight(java.lang.Double arg)
public Storefront.WeightUnit getWeightUnit()
public Storefront.ProductVariant setWeightUnit(Storefront.WeightUnit arg)
public boolean unwrapsToObject(java.lang.String key)
unwrapsToObject in class AbstractResponse<Storefront.ProductVariant>