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
|
protected Attribute |
getAttributeByIndex(int index) |
protected Attribute |
getAttributeByName(String name) |
public <T> Attribute<T> createAttribute(String name)
createAttribute
in interface AttributeBuilder
T
- Type of attribute valuename
- attribute namepublic <T> Attribute<T> createAttribute(String name, T defaultValue)
createAttribute
in interface AttributeBuilder
T
- Type of attribute valuename
- attribute namedefaultValue
- attribute's default valuepublic <T> Attribute<T> createAttribute(String name, NullaryFunction<T> initializer)
createAttribute
in interface AttributeBuilder
T
- 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)
AttributeBuilder
createAttribute
in interface AttributeBuilder
T
- Type of attribute valuename
- attribute nameinitializer
- NullaryFunction, which will be called, if Attribute's
value is null on a AttributedObjectprotected Attribute getAttributeByIndex(int index)
Copyright © 2014 Oracle Corporation. All rights reserved.