Cascading Stream Assertions are used to build robust reusable pipe assemblies. If desired, they can be planned out of a Flow instance at runtime. For more information, see the section on Stream Assertions. Below we describe the Assertions available in the core library.
The
cascading.operation.assertion.AssertEquals
Assertion asserts that the number of values given on the
constructor is equal to the number of argument Tuple values, and
that each constructor value .equals()
its
corresponding argument value.
The
cascading.operation.assertion.AssertNotEquals
Assertion asserts that the number of values given on the
constructor is equal to the number of argument Tuple values and
that each constructor value is not .equals()
to its
corresponding argument value.
The
cascading.operation.assertion.AssertEqualsAll
Assertion asserts that every value in the argument Tuple
.equals()
the single value given on the
constructor.
The
cascading.operation.assertion.AssertExpression
Assertion dynamically resolves a given Java expression (see
Expression Operations) using argument Tuple
values. Any Tuple that returns true
for the given
expression passes the assertion.
The
cascading.operation.assertion.AssertMatches
Assertion matches the given regular expression pattern String
against the entire argument Tuple. The comparison is made
possible by concatenating all the fields of the Tuple, separated
by the TAB character (\t). If a match is found, the Tuple passes
the assertion.
The
cascading.operation.assertion.AssertMatchesAll
Assertion matches the given regular expression pattern String
against each argument Tuple value individually.
The
cascading.operation.assertion.AssertNotNull
Assertion asserts that every position/field in the argument
Tuple is not null
.
The
cascading.operation.assertion.AssertNull
Assertion asserts that every position/field in the argument
Tuple is null
.
The
cascading.operation.assertion.AssertSizeEquals
Assertion asserts that the current Tuple in the tuple stream is
exactly the given size. Size, here, is the number of fields in
the Tuple, as returned by Tuple.size()
. Note that
some or all fields may be null
.
The
cascading.operation.assertion.AssertSizeLessThan
Assertion asserts that the current Tuple in the stream has a
size less than (<
) the given size. Size, here,
is the number of fields in the Tuple, as returned by
Tuple.size()
. Note that some or all fields may be
null
.
The
cascading.operation.assertion.AssertSizeMoreThan
Assertion asserts that the current Tuple in the stream has a
size greater than (>
) the given size. Size,
here, is the number of fields in the Tuple, as returned by
Tuple.size()
. Note that some or all fields may be
null
.
The
cascading.operation.assertion.AssertGroupSizeEquals
Group Assertion asserts that the number of items in the current
grouping is equal to (==
) the given size. If a
pattern String is given, only grouping keys that match the
regular expression will have this assertion applied where
multiple key values are delimited by a TAB character.
The
cascading.operation.assertion.AssertGroupSizeEquals
Group Assertion asserts that the number of items in the current
grouping is less than (<
) the given size. If a
pattern String is given, only grouping keys that match the
regular expression will have this assertion applied where
multiple key values are delimited by a TAB character.
The
cascading.operation.assertion.AssertGroupSizeEquals
Group Assertion asserts that the number of items in the current
grouping is greater than (>
) the given size. If
a pattern String is given, only grouping keys that match the
regular expression will have this assertion applied where
multiple key values are delimited by a TAB character.
Copyright © 2007-2012 Concurrent, Inc. All Rights Reserved.