Interface ConstraintPattern<E extends Enum<? extends ConstraintPattern<E>>>

Type Parameters:
E - An Enum which implemented ConstraintPattern
All Superinterfaces:
Serializable

public interface ConstraintPattern<E extends Enum<? extends ConstraintPattern<E>>> extends Serializable
An interface to indicate implemented 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 Details

    • conditionFunction

      Function<String,Boolean> conditionFunction()
      A Function providing a String is follow the syntax of version constraint. The String parameter may be null.
      Returns:
      A Function to validate version constraint.
      Since:
      2.0.0
    • acceptParseNull

      default boolean acceptParseNull()
      Some format of constraint pattern allows parse null. If this method return true, it means, this constraint pattern is accepted null.
      By default, it returns false since it rarely to allows to do it. And no duplicated Enum's value can be null.
      Returns:
      Allowing parse null for this constraint pattern format.
    • isValidConstraintMethods

      default boolean isValidConstraintMethods(@Nullable String versionConstraint)
      Determine a String of version constraint is following current Enum of ConstraintPattern or finding which ConstraintPattern uses when parsing the constraint by filtering Enum.
      Parameters:
      versionConstraint - A String (including null) of version constraint.
      Returns:
      Does this versionConstraint matched the constraint pattern.