Class BreakpointCollector<V>

java.lang.Object
org.patternfly.style.BreakpointCollector<V>
Type Parameters:
V - the type of the values to be collected
All Implemented Interfaces:
Collector<Tuple<Breakpoint,V>,StringBuilder,String>

public class BreakpointCollector<V> extends Object implements Collector<Tuple<Breakpoint,V>,StringBuilder,String>
The BreakpointCollector collects tuples of Breakpoint and a generic value V as CSS modifier classes and returns the collected data as a String. See Breakpoints for details how the CSS modifier classes are built.

The joining methods accept a string function that can be used to further modify the value. See the examples below for details.

// pf-m-foo pf-m-bar-on-lg
breakpoints(default_, "foo", lg, "bar")
        .stream().collect(modifiers());

// pf-m-prefix-foo pf-m-prefix-bar-on-lg
breakpoints(default_, "foo", lg, "bar")
        .stream().collect(modifiers(v -> "prefix-" + v));

// pf-m-a pf-m-b-on-sm-height pf-m-c-on-md-height pf-m-d-on-lg-height pf-m-e-on-xl-height pf-m-f-on-2xl-height
breakpoints(
        default_, "a",
        sm, "b",
        md, "c",
        lg, "d",
        xl, "e",
        _2xl, "f")
        .stream().collect(verticalModifiers());

See Also: