Package classes
Class Object_Product
- java.lang.Object
-
- classes.Object_BaseObject
-
- classes.Object_Product
-
- All Implemented Interfaces:
android.os.Parcelable
public class Object_Product extends Object_BaseObject
Represents a product (e.g., wines, beers, spirits) within the Preferabli SDK. A product may have one or moreObject_Variants stored asvariants. A variant can have one or moreObject_Tags which are used to associate a product with a user's interaction (e.g., rating) or with a particularObject_Collection. With respect to aObject_Customer, a product return may also includeObject_PreferenceDatawhich identifies the customer's affinity for the product. SeeObject_Variant.getPreferabliScore(Boolean, API_ResultHandler). To see how a product is mapped to your own object(s), seeObject_Variant.getMerchantLinks(). To see a user's interaction with the product, seeObject_Variant.getTags().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classObject_Product.Other_ProductCategoryThe category of aObject_Product.static classObject_Product.Other_ProductTypeThe recognized type of aObject_Product.
-
Constructor Summary
Constructors Constructor Description Object_Product()Object_Product(long id, java.lang.String name, java.lang.String grape, boolean decant, boolean show_year_dropdown, java.lang.String type, java.lang.String image, java.lang.String backImage, java.lang.String brand, java.lang.String region, java.lang.String created_at, java.lang.String updated_at, boolean isDirty, double brand_lat, double brand_lon, java.lang.String category, java.lang.String rateSourceLocation, java.lang.String subcategory, java.lang.String hash)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVariant(Object_Variant variant)booleanfilter(java.io.Serializable serializable)Object_MediagetBackImage()java.lang.StringgetBrand()doublegetBrandLat()doublegetBrandLon()java.util.HashSet<Object_Tag>getCellarTags()All of the product tags of typeObject_Tag.Other_TagType.CELLARfor the current user.java.lang.StringgetCreatedAt()java.lang.StringgetGrape()java.lang.StringgetHash()java.lang.StringgetImage(int width, int height, int quality)Get the product's image.Object_TaggetMostRecentRating()The most recent product tag of typeObject_Tag.Other_TagType.RATINGfor the current user.Object_VariantgetMostRecentVariant()The most recentObject_Variantfor a product.java.lang.StringgetName()voidgetPreferabliScore(java.lang.Boolean force_refresh, API_ResultHandler<Object_PreferenceData> handler)java.lang.StringgetPrice()Gets the price range of the most recentObject_Variant.Object_MediagetPrimaryImage()Object_Product.Other_ProductCategorygetProductCategory()The category of a product.Object_Product.Other_ProductTypegetProductType()The type of a product (e.g., Red).java.util.HashSet<Object_Tag>getPurchaseTags()All of the product tags of typeObject_Tag.Other_TagType.PURCHASEfor the current user.Object_Tag.Other_RatingLevelgetRatingLevel()TheObject_Tag.Other_RatingLevelof the most recent rating of a specific product for the current user.java.util.HashSet<Object_Tag>getRatingTags()All of the product tags of typeObject_Tag.Other_TagType.RATINGfor the current user.java.lang.StringgetRegion()java.lang.StringgetSubcategory()java.lang.StringgetUpdatedAt()java.util.ArrayList<Object_Variant>getVariants()Object_VariantgetVariantWithId(long id)Get aObject_Variantof a product by its id.Object_VariantgetVariantWithYear(int year)Get aObject_Variantof a product by its year.Object_TaggetWishlistTag()The first instance within the product of tag typeObject_Tag.Other_TagType.WISHLISTfor the current user.booleanisBeingIdentified()Identifies if a product is still being curated.booleanisDecant()booleanisNonVariant()booleanisOnWishlist()booleanisShowYearDropdown()voidlttt(java.lang.Long collection_id, java.lang.Boolean include_merchant_links, API_ResultHandler<java.util.ArrayList<Object_Product>> handler)voidrate(Object_Tag.Other_RatingLevel rating, java.lang.String location, java.lang.String notes, java.lang.Double price, java.lang.Integer quantity, java.lang.Integer format_ml, API_ResultHandler<Object_Product> handler)voidtoggleWishlist(API_ResultHandler<Object_Product> handler)voidwhereToBuy(Other_FulfillSort fulfill_sort, java.lang.Boolean append_nonconforming_results, java.lang.Boolean lock_to_integration, API_ResultHandler<Object_WhereToBuy> handler)voidwriteToParcel(android.os.Parcel dest, int flags)-
Methods inherited from class classes.Object_BaseObject
describeContents, equals, getId, hashCode, setId
-
-
-
-
Constructor Detail
-
Object_Product
public Object_Product()
-
Object_Product
public Object_Product(long id, java.lang.String name, java.lang.String grape, boolean decant, boolean show_year_dropdown, java.lang.String type, java.lang.String image, java.lang.String backImage, java.lang.String brand, java.lang.String region, java.lang.String created_at, java.lang.String updated_at, boolean isDirty, double brand_lat, double brand_lon, java.lang.String category, java.lang.String rateSourceLocation, java.lang.String subcategory, java.lang.String hash)
-
-
Method Detail
-
getHash
public java.lang.String getHash()
-
getProductType
public Object_Product.Other_ProductType getProductType()
The type of a product (e.g., Red). Only for wines.- Returns:
- product type.
-
getProductCategory
public Object_Product.Other_ProductCategory getProductCategory()
The category of a product.- Returns:
- product category.
-
isShowYearDropdown
public boolean isShowYearDropdown()
-
getBackImage
public Object_Media getBackImage()
-
getBrandLat
public double getBrandLat()
-
getBrandLon
public double getBrandLon()
-
isOnWishlist
public boolean isOnWishlist()
-
getRatingTags
public java.util.HashSet<Object_Tag> getRatingTags()
All of the product tags of typeObject_Tag.Other_TagType.RATINGfor the current user.- Returns:
- an array of tags.
-
getCellarTags
public java.util.HashSet<Object_Tag> getCellarTags()
All of the product tags of typeObject_Tag.Other_TagType.CELLARfor the current user.- Returns:
- an array of tags.
-
getPurchaseTags
public java.util.HashSet<Object_Tag> getPurchaseTags()
All of the product tags of typeObject_Tag.Other_TagType.PURCHASEfor the current user.- Returns:
- an array of tags.
-
addVariant
public void addVariant(Object_Variant variant)
-
getImage
public java.lang.String getImage(int width, int height, int quality)Get the product's image.- Parameters:
width- returns an image with the specified width in pixels.height- returns an image with the specified height in pixels.quality- returns an image with the specified quality. Scales from 0 - 100.- Returns:
- the URL of the requested image.
-
getPrimaryImage
public Object_Media getPrimaryImage()
-
getUpdatedAt
public java.lang.String getUpdatedAt()
-
getVariants
public java.util.ArrayList<Object_Variant> getVariants()
-
getVariantWithId
public Object_Variant getVariantWithId(long id)
Get aObject_Variantof a product by its id.- Parameters:
id- a variant id.- Returns:
- the corresponding variant. Returns null if this product does not contain the variant.
-
getVariantWithYear
public Object_Variant getVariantWithYear(int year)
Get aObject_Variantof a product by its year.- Parameters:
year- a variant year.- Returns:
- the corresponding variant. Returns null if this product does not contain the variant.
-
isDecant
public boolean isDecant()
-
isNonVariant
public boolean isNonVariant()
-
getCreatedAt
public java.lang.String getCreatedAt()
-
getName
public java.lang.String getName()
-
getBrand
public java.lang.String getBrand()
-
isBeingIdentified
public boolean isBeingIdentified()
Identifies if a product is still being curated.- Returns:
- true if the product has not been curated.
-
getRegion
public java.lang.String getRegion()
-
getGrape
public java.lang.String getGrape()
-
getPrice
public java.lang.String getPrice()
Gets the price range of the most recentObject_Variant. Prices represent Retail | Restaurant $ = Less than $12 | < $30 $$ = $12 to $19.99 | $30 - $45 $$$ = $20 to $49.99 | $45 - $110 $$$$ = $50 to $74.99 | $110 - $160 $$$$$ = $75 and up | > $160- Returns:
- price range represented by dollar signs in a string.
-
getSubcategory
public java.lang.String getSubcategory()
-
getMostRecentVariant
public Object_Variant getMostRecentVariant()
The most recentObject_Variantfor a product.- Returns:
- a product variant.
-
getMostRecentRating
public Object_Tag getMostRecentRating()
The most recent product tag of typeObject_Tag.Other_TagType.RATINGfor the current user.- Returns:
- a tag.
-
getWishlistTag
public Object_Tag getWishlistTag()
The first instance within the product of tag typeObject_Tag.Other_TagType.WISHLISTfor the current user.- Returns:
- a tag.
-
getRatingLevel
public Object_Tag.Other_RatingLevel getRatingLevel()
TheObject_Tag.Other_RatingLevelof the most recent rating of a specific product for the current user.- Returns:
- rating level.
-
filter
public boolean filter(java.io.Serializable serializable)
- Overrides:
filterin classObject_BaseObject
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)- Specified by:
writeToParcelin interfaceandroid.os.Parcelable- Overrides:
writeToParcelin classObject_BaseObject
-
whereToBuy
public void whereToBuy(Other_FulfillSort fulfill_sort, java.lang.Boolean append_nonconforming_results, java.lang.Boolean lock_to_integration, API_ResultHandler<Object_WhereToBuy> handler)
-
rate
public void rate(Object_Tag.Other_RatingLevel rating, java.lang.String location, java.lang.String notes, java.lang.Double price, java.lang.Integer quantity, java.lang.Integer format_ml, API_ResultHandler<Object_Product> handler)
-
toggleWishlist
public void toggleWishlist(API_ResultHandler<Object_Product> handler)
-
lttt
public void lttt(java.lang.Long collection_id, java.lang.Boolean include_merchant_links, API_ResultHandler<java.util.ArrayList<Object_Product>> handler)
-
getPreferabliScore
public void getPreferabliScore(java.lang.Boolean force_refresh, API_ResultHandler<Object_PreferenceData> handler)
-
-