Module xyz.ronella.casual.trivial
Package xyz.ronella.trivial.handy
Class NPESilencer.NPESilencerBuilder<TYPE_ROOT_OBJECT,TYPE_OUTPUT>
java.lang.Object
xyz.ronella.trivial.handy.NPESilencer.NPESilencerBuilder<TYPE_ROOT_OBJECT,TYPE_OUTPUT>
- Type Parameters:
TYPE_ROOT_OBJECT- The type of the root object of the expression.TYPE_OUTPUT- The type of output that the expression will produce.
- Enclosing class:
- NPESilencer<TYPE_ROOT_OBJECT,
TYPE_OUTPUT>
The only class that can create NPESilencer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd an expression to be evaluated.Add an expression to be evaluated.addRoot(TYPE_ROOT_OBJECT root) Add the root object of all the expressions.build()Actually creates an instance of NPESilencer.
-
Constructor Details
-
NPESilencerBuilder
public NPESilencerBuilder()
-
-
Method Details
-
addRoot
Add the root object of all the expressions. This can be called just once. If you call it again, it will overwrite the existing root object.- Parameters:
root- The instance of the root object expression.- Returns:
- An instance of the builder.
-
addExpr
Add an expression to be evaluated. This can be called multiple times. This will create a chain of expression evaluations where the output of earlier expression will be the argument of the following expression.- Parameters:
expression- The instance of the root object expression.- Returns:
- An instance of the builder.
-
addExpr
Add an expression to be evaluated. This can be called multiple times. This will create a chain of expression evaluations where the output of earlier expression will be ignored by the following expression.- Parameters:
expression- The instance of the root object expression.- Returns:
- An instance of the builder.
-
build
Actually creates an instance of NPESilencer.- Returns:
- An instance of NPESilencer.
-