public class DefaultAttributeBuilder extends Object implements AttributeBuilder
AttributeBuilder implementation.AttributeBuilder| Modifier and Type | Field and Description |
|---|---|
protected List<Attribute> |
attributes |
protected Map<String,Attribute> |
name2Attribute |
DEFAULT_ATTRIBUTE_BUILDER| Constructor and Description |
|---|
DefaultAttributeBuilder() |
| Modifier and Type | Method and Description |
|---|---|
<T> Attribute<T> |
createAttribute(String name)
Create Attribute with name
|
<T> Attribute<T> |
createAttribute(String name,
NullaryFunction<T> initializer)
Create Attribute with name and initializer, which will be called, if
Attribute's value is null on a AttributedObject
|
<T> Attribute<T> |
createAttribute(String name,
NullaryFunction<T> initializer)
Create Attribute with name and initializer, which will be called, if
Attribute's value is null on a AttributedObject
|
<T> Attribute<T> |
createAttribute(String name,
T defaultValue)
Create Attribute with name and default value
|
AttributeHolder |
createSafeAttributeHolder()
Creates and returns new thread-safe
AttributeHolder |
AttributeHolder |
createUnsafeAttributeHolder()
Creates and returns new non thread-safe
AttributeHolder |
protected Attribute |
getAttributeByIndex(int index) |
protected Attribute |
getAttributeByName(String name) |
public <T> Attribute<T> createAttribute(String name)
createAttribute in interface AttributeBuilderT - Type of attribute valuename - attribute namepublic <T> Attribute<T> createAttribute(String name, T defaultValue)
createAttribute in interface AttributeBuilderT - Type of attribute valuename - attribute namedefaultValue - attribute's default valuepublic <T> Attribute<T> createAttribute(String name, NullaryFunction<T> initializer)
createAttribute in interface AttributeBuilderT - Type of attribute valuename - attribute nameinitializer - NullaryFunction, which will be called, if Attribute's
value is null on a AttributedObjectpublic <T> Attribute<T> createAttribute(String name, NullaryFunction<T> initializer)
AttributeBuildercreateAttribute in interface AttributeBuilderT - Type of attribute valuename - attribute nameinitializer - NullaryFunction, which will be called, if Attribute's
value is null on a AttributedObjectpublic AttributeHolder createSafeAttributeHolder()
AttributeBuilderAttributeHoldercreateSafeAttributeHolder in interface AttributeBuilderAttributeHolderpublic AttributeHolder createUnsafeAttributeHolder()
AttributeBuilderAttributeHoldercreateUnsafeAttributeHolder in interface AttributeBuilderAttributeHolderprotected Attribute getAttributeByIndex(int index)
Copyright © 2012-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.