public final class Attribute<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Attribute.AttributeSupplier<T> |
Modifier and Type | Method and Description |
---|---|
static <T,R> Attribute.AttributeSupplier<T> |
create(String attributeName,
Function<T,R> getAttributeMethod,
BiConsumer<T,R> updateItemMethod,
AttributeType<R> attributeType) |
<R> Attribute<R> |
transform(Function<R,T> transform,
Consumer<R> createComponent)
Return a transformed copy of this attribute that knows how to get/set from a different type of object given a
function that can convert the containing object itself.
|
public static <T,R> Attribute.AttributeSupplier<T> create(String attributeName, Function<T,R> getAttributeMethod, BiConsumer<T,R> updateItemMethod, AttributeType<R> attributeType)
public <R> Attribute<R> transform(Function<R,T> transform, Consumer<R> createComponent)
R
- The type being transformed to.transform
- A function that converts the object storing the attribute from the source type to the
destination type.createComponent
- A consumer to create a new instance of the component object when required. A null value
will bypass this logic.Copyright © 2020. All rights reserved.