# addAllLater

@Incubating
abstract fun addAllLater(other: AttributeContainer): AttributeContainer(source)

Lazily add all attributes from `other` to this container.

If the given attribute container contains attribute keys that already exist in this container, the corresponding values in this container will be overwritten. Subsequent calls to attribute and attributeProvider will overwrite the corresponding values from this call.

Consider the following example:

        def color = Attribute.of("color", String)
        def shape = Attribute.of("shape", String)

        def foo = configurations.create("foo").attributes
        foo.attribute(color, "green")

        def bar = configurations.create("bar").attributes
        bar.attribute(color, "red")
        bar.attribute(shape, "square")
        assert bar.getAttribute(color) == "red"    // `color` is originally red

        bar.addAllLater(foo)
        assert bar.getAttribute(color) == "green"  // `color` gets overwritten
        assert bar.getAttribute(shape) == "square" // `shape` does not

        foo.attribute(color, "purple")
        bar.getAttribute(color) == "purple"        // addAllLater is lazy

        bar.attribute(color, "orange")
        assert bar.getAttribute(color) == "orange" // `color` gets overwritten again
        assert bar.getAttribute(shape) == "square" // `shape` remains the same

Content copied to clipboard

#### Return

this container

#### Since

9.1.0