@PublicEvolving public final class ConstantArgumentCount extends Object implements ArgumentCount
ArgumentCount
with constant boundaries.
Note: All boundaries of this class are inclusive. All indices are 0-based.
Modifier and Type | Method and Description |
---|---|
static ConstantArgumentCount |
any() |
static ConstantArgumentCount |
between(int minCount,
int maxCount) |
boolean |
equals(Object o) |
static ConstantArgumentCount |
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 ConstantArgumentCount |
of(int count) |
static ConstantArgumentCount |
to(int maxCount) |
public static ConstantArgumentCount of(int count)
public static ConstantArgumentCount between(int minCount, int maxCount)
public static ConstantArgumentCount from(int minCount)
public static ConstantArgumentCount to(int maxCount)
public static ConstantArgumentCount 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–2024 The Apache Software Foundation. All rights reserved.