Iterable<Result.Attribute>
public static class Result.Variant extends Object implements Iterable<Result.Attribute>
Constructor | Description |
---|---|
Variant() |
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 variant.
|
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 variant.
|
String |
getValue(String attributeName) |
Get the attribute with the specified
name from this variant or null if no such attribute exists. |
String |
getValue(String attributeName,
String defaultValue) |
Get the value of the attribute with the specified
attributeName . |
Iterator<Result.Attribute> |
iterator() |
|
String |
key() |
Return the key of this variant.
|
static Result.Variant |
mock(String key,
String ticket,
List<Result.Attribute> attributes) |
Creates a new Variant object for test purposes.
|
static Result.Variant |
mock(String key,
String ticket,
List<Result.Attribute> attributes,
Map<String,List<Result.CategoryData>> categoryReferenceAttributes) |
Creates a new Variant object with category references for test purposes.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static Result.Variant mock(String key, String ticket, List<Result.Attribute> attributes)
key
- the variant keyticket
- the variant ticketattributes
- the variant attributespublic static Result.Variant mock(String key, String ticket, List<Result.Attribute> attributes, Map<String,List<Result.CategoryData>> categoryReferenceAttributes)
key
- the variant keyticket
- the variant ticketattributes
- the variant 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 variant 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 variant doesn't have an attribute with the specified
attributeName
public String getTicket()
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>
Copyright © 2020 Apptus Technologies AB. All rights reserved.