-
public interface HostFunBuilder
An immutable buildre of host funs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FunVal
action(ThrowingFunction1<? super CallContext,? extends HostResult> action)
Makes a fun.HostFunBuilder
desc(String desc)
Returns a new builder with the specified desc, and all the other properties inherited fromthis
.HostFunBuilder
take(int numArgs)
Returns a new builder with the specified number of args.HostFunBuilder
takeMin(int argsMin)
Returns a new builder with the specified minimum number of args.HostFunBuilder
takeMinMax(int argsMin, int argsMax)
Returns a builder with the specified minimum and the maximum number of args.
-
-
-
Method Detail
-
desc
HostFunBuilder desc(String desc)
Returns a new builder with the specified desc, and all the other properties inherited fromthis
.- Parameters:
desc
- the desc of the fun.- Returns:
- a new builder.
-
take
HostFunBuilder take(int numArgs)
Returns a new builder with the specified number of args.The number of args passed to a fun built by the result builder must be equal to
numArgs
.Precondition: numArgs must be nonnegative.
- Parameters:
numArgs
- the number of args which the fun takes.- Returns:
- a new builder.
-
takeMin
HostFunBuilder takeMin(int argsMin)
Returns a new builder with the specified minimum number of args.The number of args passed to a fun built by the result builder must be greater than or equal to
argsMin
.Precondition: argsMin must be nonnegative.
- Parameters:
argsMin
- the minimum number of args which the fun takes.- Returns:
- a new builder.
-
takeMinMax
HostFunBuilder takeMinMax(int argsMin, int argsMax)
Returns a builder with the specified minimum and the maximum number of args.The number of args passed to a fun built by the result builder must be in the range
[argsMin, argsMax]
.Precondition:
- argsMin must be nonnegative
- argsMin must be less than or equal to argsMax
- Parameters:
argsMin
- the minimum number of args which the fun takes.argsMax
- the maximum number of args which the fun takes.- Returns:
- a new builder.
-
action
FunVal action(ThrowingFunction1<? super CallContext,? extends HostResult> action)
Makes a fun.- Parameters:
action
- action which is called after args checking passes.- Returns:
- a fun.
-
-