T
- the type of the target value which should be extracted from the attribute value. Most likely this will be String
.public final class AttributeExtraction<T> extends Base
This is a functional approach, DefaultProductAttributeFormatter
provides an object oriented way to achieve the same.
A possible use case is documented here.
Attribute
Modifier and Type | Method and Description |
---|---|
Optional<T> |
findValue() |
T |
getValue() |
<I> AttributeExtraction<T> |
ifGuarded(AttributeAccess<I> extraction,
Function<I,Optional<T>> function) |
<A> AttributeExtraction<T> |
ifIs(AttributeAccess<A> extraction,
Function<? super A,? extends T> function,
Predicate<? super A> guard) |
<I> AttributeExtraction<T> |
ifIs(AttributeAccess<I> extraction,
Function<? super I,? extends T> function) |
static <T> AttributeExtraction<T> |
of(AttributeDefinition attributeDefinition,
Attribute attribute) |
static <T> AttributeExtraction<T> |
of(AttributeDefinitionContainer productType,
Attribute attribute) |
public static <T> AttributeExtraction<T> of(AttributeDefinitionContainer productType, Attribute attribute)
public static <T> AttributeExtraction<T> of(AttributeDefinition attributeDefinition, Attribute attribute)
public <I> AttributeExtraction<T> ifGuarded(AttributeAccess<I> extraction, Function<I,Optional<T>> function)
public <I> AttributeExtraction<T> ifIs(AttributeAccess<I> extraction, Function<? super I,? extends T> function)
public <A> AttributeExtraction<T> ifIs(AttributeAccess<A> extraction, Function<? super A,? extends T> function, Predicate<? super A> guard)