Iterable<Result.Attribute>
public static class Result.Product extends Object implements Iterable<Result.Attribute>
Constructor | Description |
---|---|
Product() |
Modifier and Type | Method | Description |
---|---|---|
Result.Attribute |
getAttribute(String name) |
Get the attribute with the specified name or null if no such attribute exists for this product.
|
List<Result.CategoryData> |
getCategories(String categoryReferenceAttribute) |
Get the category objects of the given category reference attribute.
|
Set<String> |
getCategoryReferenceAttributes() |
Get the available category reference attributes in the product.
|
String |
getTicket() |
Get the notification ticket of this product.
|
String |
getValue(String attributeName) |
Get the attribute with the specified
name from this product or null if no such attribute exists. |
String |
getValue(String attributeName,
String defaultValue) |
Get the value of the attribute with the specified
attributeName . |
List<Result.Variant> |
getVariants() |
|
Iterator<Result.Attribute> |
iterator() |
|
String |
key() |
Return the key of this product.
|
static Result.Product |
mock(String key,
String ticket,
List<Result.Variant> variants,
List<Result.Attribute> attributes) |
Creates a new Product object for test purposes.
|
static Result.Product |
mock(String key,
String ticket,
List<Result.Variant> variants,
List<Result.Attribute> attributes,
Map<String,List<Result.CategoryData>> categoryReferenceAttributes) |
Creates a new Product object with category references for test purposes.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static Result.Product mock(String key, String ticket, List<Result.Variant> variants, List<Result.Attribute> attributes)
key
- the product keyticket
- the product ticketvariants
- variants included in the productattributes
- the product attributespublic static Result.Product mock(String key, String ticket, List<Result.Variant> variants, List<Result.Attribute> attributes, Map<String,List<Result.CategoryData>> categoryReferenceAttributes)
key
- the product keyticket
- the product ticketvariants
- variants included in the productattributes
- the product attributescategoryReferenceAttributes
- map of category data referencespublic final Result.Attribute getAttribute(String name)
name
- the name of the attribute to getpublic final String key()
public final String getValue(String attributeName)
name
from this product or null if no such attribute exists.attributeName
- The name of the attribute whose value to retrievepublic final String getValue(String attributeName, String defaultValue)
attributeName
. The specified defaultValue
will be returned if no such attribute exists.attributeName
- The name of the attribute whose value to retrievedefaultValue
- The value to return if this product doesn't have an attribute with the specified
attributeName
public Set<String> getCategoryReferenceAttributes()
public List<Result.CategoryData> getCategories(String categoryReferenceAttribute)
categoryReferenceAttribute
- the category reference attribute to get the categories forpublic Iterator<Result.Attribute> iterator()
iterator
in interface Iterable<Result.Attribute>
public String getTicket()
public List<Result.Variant> getVariants()
Copyright © 2020 Apptus Technologies AB. All rights reserved.