Class SimpleAttributes.Builder
java.lang.Object
dev.getelements.elements.sdk.util.SimpleAttributes.Builder
- Enclosing class:
SimpleAttributes
Builder for
SimpleAttributes.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a new instance ofSimpleAttributesbased on this builder.from(Attributes attributes) Copies all values from anotherAttributesinto thisSimpleAttributes.Builder.from(Attributes attributes, BiPredicate<String, Object> filter) Copies all values from anotherAttributesinto thisSimpleAttributes.Builder, filtering out attributes based on the suppliedBiPredicate.from(Iterable<ElementDefaultAttributeRecord> defaultAttributeRecords) Copies all values from anotherAttributesinto thisSimpleAttributes.Builder.setAttribute(String name, Object value) Sets the provided attribute using the name and value.setAttributes(Map<String, Object> attributes)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setAttributes
Bulk-sets attributes using the suppliedMap<String,. All supplied attributes will be added and existing keys overwritten with the values present in the supplied map.Object> Passing null will have no effect.
- Parameters:
attributes- the map of attributes, or null.- Returns:
- this instance
-
setAttribute
Sets the provided attribute using the name and value.- Parameters:
name- the attribute namevalue- the attribute value- Returns:
- this instance
-
from
Copies all values from anotherAttributesinto thisSimpleAttributes.Builder.- Parameters:
attributes- theAttributes- Returns:
- this instance
-
from
Copies all values from anotherAttributesinto thisSimpleAttributes.Builder, filtering out attributes based on the suppliedBiPredicate.- Parameters:
attributes- theAttributesfilter- aBiPredicate<String,used to select specific entries to copyObject> - Returns:
- this instance
-
from
public SimpleAttributes.Builder from(Iterable<ElementDefaultAttributeRecord> defaultAttributeRecords) Copies all values from anotherAttributesinto thisSimpleAttributes.Builder.- Parameters:
defaultAttributeRecords- a collection ofElementDefaultAttributeRecord- Returns:
- this instance
-
build
Returns a new instance ofSimpleAttributesbased on this builder.- Returns:
- a new instance of
SimpleAttributes
-