[Index]

bus:filter


Filter out beans passing through the bus according to an java.util.function.Predicate.

Property Summary

blocked Number of items blocked by the predicate.
name The name of this component.
passed Number of items passing the predicate.
predicate The predicate.
to The next component in a bus.

Example Summary

Example 1 Filter out Bananas.

Property Detail

blocked

AccessREAD_ONLY
RequiredRead only.

Number of items blocked by the predicate.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The name of this component.

passed

AccessREAD_ONLY
RequiredRead only.

Number of items passing the predicate.

predicate

Configured ByELEMENT
AccessREAD_WRITE
RequiredYes.

The predicate.

to

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo.

The next component in a bus. Set automatically in a bus:bus.


Examples

Example 1

Filter out Bananas.

<oddjob>
    <job>
        <bus:bus id="bean-bus" xmlns:bus="oddjob:beanbus">
            <of>
                <bus:driver>
                    <values>
                        <list>
                            <values>
                                <bean class="org.oddjob.beanbus.example.Fruit" quantity="42" type="Apple" price="25.5"/>
                                <bean class="org.oddjob.beanbus.example.Fruit" quantity="24" type="Banana" price="36.2"/>
                                <bean class="org.oddjob.beanbus.example.Fruit" quantity="15" type="Pear" price="40.4"/>
                            </values>
                        </list>
                    </values>
                </bus:driver>
                <bus:filter>
                    <predicate>
                        <bean class="org.oddjob.beanbus.example.RemoveFruit" remove="Banana"/>
                    </predicate>
                </bus:filter>
                <bus:collect id="results"/>
            </of>
        </bus:bus>
    </job>
</oddjob>


(c) R Gordon Ltd 2005 - Present