@Internal public final class ConstantArgumentCount extends Object implements ArgumentCount
ArgumentCount
with constant boundaries.
Note: All boundaries of this class are inclusive.
Modifier and Type | Method and Description |
---|---|
static ArgumentCount |
any() |
static ArgumentCount |
between(int minCount,
int maxCount) |
boolean |
equals(Object o) |
static ArgumentCount |
from(int minCount) |
Optional<Integer> |
getMaxCount()
Returns the maximum number of argument (inclusive) that a function can take.
|
Optional<Integer> |
getMinCount()
Returns the minimum number of argument (inclusive) that a function can take.
|
int |
hashCode() |
boolean |
isValidCount(int count)
Enables custom validation of argument counts after
ArgumentCount.getMinCount() and
ArgumentCount.getMaxCount() have been validated. |
static ArgumentCount |
of(int count) |
public static ArgumentCount of(int count)
public static ArgumentCount between(int minCount, int maxCount)
public static ArgumentCount from(int minCount)
public static ArgumentCount any()
public boolean isValidCount(int count)
ArgumentCount
ArgumentCount.getMinCount()
and
ArgumentCount.getMaxCount()
have been validated.isValidCount
in interface ArgumentCount
count
- total number of arguments including each argument for a vararg function callpublic Optional<Integer> getMinCount()
ArgumentCount
Optional.empty()
if such a lower bound is not defined.
getMinCount
in interface ArgumentCount
public Optional<Integer> getMaxCount()
ArgumentCount
Optional.empty()
if such an upper bound is not defined.
getMaxCount
in interface ArgumentCount
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.