Package xyz.rk0cc.josev.constraint
Interface ConstraintPattern<E extends Enum<? extends ConstraintPattern<E>>>
- Type Parameters:
E
- AnEnum
which implementedConstraintPattern
- All Superinterfaces:
Serializable
public interface ConstraintPattern<E extends Enum<? extends ConstraintPattern<E>>>
extends Serializable
An interface to indicate implemented
There are various of constraint pattern format on different system. Currently, no standard version constraint pattern has been released that it's very rely on
Enum
as constraint pattern in SemVerConstraint
.
There are various of constraint pattern format on different system. Currently, no standard version constraint pattern has been released that it's very rely on
Enum
with ConstraintPattern
implemented to find which
pattern is used when calling parser
.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Some format of constraint pattern allows parsenull
.default boolean
isValidConstraintMethods
(String versionConstraint) Determine aString
of version constraint is following currentEnum
ofConstraintPattern
or finding whichConstraintPattern
uses whenparsing
the constraint byfiltering
Enum
.
-
Method Details
-
conditionFunction
AFunction
providing aString
is follow the syntax of version constraint. TheString
parameter may benull
.- Returns:
- A
Function
to validate version constraint. - Since:
- 2.0.0
-
acceptParseNull
default boolean acceptParseNull()Some format of constraint pattern allows parsenull
. If this method returntrue
, it means, this constraint pattern is acceptednull
.
By default, it returnsfalse
since it rarely to allows to do it. And no duplicatedEnum's value
can benull
.- Returns:
- Allowing parse
null
for this constraint pattern format.
-
isValidConstraintMethods
Determine aString
of version constraint is following currentEnum
ofConstraintPattern
or finding whichConstraintPattern
uses whenparsing
the constraint byfiltering
Enum
.- Parameters:
versionConstraint
- AString
(includingnull
) of version constraint.- Returns:
- Does this
versionConstraint
matched the constraint pattern.
-