Class EnvironmentAttributeMap.Builder
java.lang.Object
dev.wyck.wrapper.environment.attribute.EnvironmentAttributeMap.Builder
- Enclosing class:
EnvironmentAttributeMap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattribute(EnvironmentAttributeSupplier<V> supplier, V value) Sets an attribute in the builder.attribute(FriendlyColorSupplier supplier, String hex) Sets a color attribute in the builder using a hex string.build()Builds the WrappedEnvironmentAttributeMap.clear()Removes all attributes from this builder.merge(EnvironmentAttributeMap source) Adds all attributes from the given map.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
attribute
@AsOf("1.1.0") public <V> EnvironmentAttributeMap.Builder attribute(EnvironmentAttributeSupplier<V> supplier, V value) Sets an attribute in the builder. If an attribute with the same handle is already present, this throws to flag the duplicate to the caller.- Type Parameters:
V- the type of the attribute- Parameters:
supplier- the attribute suppliervalue- the exposed value- Returns:
- the builder
- Since:
- 1.1.0
-
attribute
@AsOf("2.1.0") public EnvironmentAttributeMap.Builder attribute(FriendlyColorSupplier supplier, String hex) Sets a color attribute in the builder using a hex string.- Parameters:
supplier- the color attribute supplierhex- the hex value (e.g."#FF10F0")- Returns:
- the builder
- Since:
- 2.1.0
-
clear
Removes all attributes from this builder.- Returns:
- the builder
- Since:
- 2.1.0
-
merge
Adds all attributes from the given map. Throws if any key collides with an existing entry.- Parameters:
source- the map to add- Returns:
- the builder
- Since:
- 2.1.0
-
build
Builds the WrappedEnvironmentAttributeMap.- Returns:
- the WrappedEnvironmentAttributeMap
- Since:
- 1.1.0
-