Package com.basistech.rosette.dm
Class ListAttribute.Builder<Item extends BaseAttribute>
java.lang.Object
com.basistech.rosette.dm.BaseAttribute.Builder<ListAttribute<Item>,ListAttribute.Builder<Item>>
com.basistech.rosette.dm.ListAttribute.Builder<Item>
- Type Parameters:
Item
- the type of attribute in the list
- Enclosing class:
- ListAttribute<Item extends BaseAttribute>
public static class ListAttribute.Builder<Item extends BaseAttribute>
extends BaseAttribute.Builder<ListAttribute<Item>,ListAttribute.Builder<Item>>
A builder for lists.
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder
(Class<? extends BaseAttribute> itemClass) Constructs an empty builder. -
Method Summary
Modifier and TypeMethodDescriptionAdds one item to the list.build()
Constructs an immutable list from the current state of the builder.protected ListAttribute.Builder<Item>
getThis()
Specifies the complete list of items.Methods inherited from class com.basistech.rosette.dm.BaseAttribute.Builder
addAllToList, addAllToSet, buildExtendedProperties, extendedProperties, extendedProperty, nullOrList
-
Constructor Details
-
Builder
Constructs an empty builder.- Parameters:
itemClass
- the class for the items to be stored in the list
-
-
Method Details
-
add
Adds one item to the list.- Parameters:
item
- the item to add- Returns:
- this
-
setItems
Specifies the complete list of items.- Parameters:
items
- all the items- Returns:
- this
-
build
Constructs an immutable list from the current state of the builder.- Returns:
- the new list
-
getThis
- Specified by:
getThis
in classBaseAttribute.Builder<ListAttribute<Item extends BaseAttribute>,
ListAttribute.Builder<Item extends BaseAttribute>>
-