public interface ArgumentConstraint
| Modifier and Type | Method and Description |
|---|---|
boolean |
arityViolated(int n) |
<T> Iterator<ArgumentError> |
check(Adapter<T> runtime,
Iterator<FunctionArgument<T>> arguments,
boolean expectNoRemainingArguments)
Check that the argument list complies with the constraints.
|
String |
expectedType() |
int |
maxArity() |
int |
minArity() |
<T> Iterator<ArgumentError> check(Adapter<T> runtime, Iterator<FunctionArgument<T>> arguments, boolean expectNoRemainingArguments)
Most constraints will consume one or more elements from the iterator, but constraints that represents optional arguments may choose not to.
Any errors found will be returned as an iterator of ArgumentError.
When this iterator is empty no errors were found. The iterator may or may
not contain all errors that could be found, errors may make the checker
return as soon as they are encountered and not attempt to check the
remaining arguments.
When expectNoRemainingArguments is true and there remain
elements in the iterator after all checks have been performed an error will
be returned.
int minArity()
int maxArity()
boolean arityViolated(int n)
n - the number of arguments to check against minArity & maxArityString expectedType()
Copyright © 2016–2021. All rights reserved.