Class EnvironmentAttributeMap.Builder

java.lang.Object
dev.wyck.wrapper.environment.attribute.EnvironmentAttributeMap.Builder
Enclosing class:
EnvironmentAttributeMap

@AsOf("2.1.0") public static class EnvironmentAttributeMap.Builder extends Object
A builder for creating WrappedEnvironmentAttributeMap instances.
Since:
1.1.0
  • 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 supplier
      value - 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 supplier
      hex - the hex value (e.g. "#FF10F0")
      Returns:
      the builder
      Since:
      2.1.0
    • clear

      @AsOf("2.1.0") public EnvironmentAttributeMap.Builder 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

      @AsOf("1.1.0") public EnvironmentAttributeMap build()
      Builds the WrappedEnvironmentAttributeMap.
      Returns:
      the WrappedEnvironmentAttributeMap
      Since:
      1.1.0