Class CompositeExpression
java.lang.Object
com.github.zafarkhaja.semver.expr.CompositeExpression
- All Implemented Interfaces:
Expression
This class implements internal DSL for the
SemVer Expressions using fluent interface.
- Since:
- 0.9.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA class with static helper methods. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs aCompositeExpressionwith an underlyingExpression. -
Method Summary
Modifier and TypeMethodDescriptionand(Expression expr) Adds anotherExpressiontoCompositeExpressionusingAndlogical expression.booleanInterprets the expression.booleanInterprets the expression.or(Expression expr) Adds anotherExpressiontoCompositeExpressionusingOrlogical expression.
-
Field Details
-
exprTree
The underlying expression tree.
-
-
Constructor Details
-
CompositeExpression
Constructs aCompositeExpressionwith an underlyingExpression.- Parameters:
expr- the underlying expression
-
-
Method Details
-
and
Adds anotherExpressiontoCompositeExpressionusingAndlogical expression.- Parameters:
expr- an expression to add- Returns:
- this
CompositeExpression
-
or
Adds anotherExpressiontoCompositeExpressionusingOrlogical expression.- Parameters:
expr- an expression to add- Returns:
- this
CompositeExpression
-
interpret
Interprets the expression.- Parameters:
version- aVersionstring to interpret against- Returns:
- the result of the expression interpretation
- Throws:
IllegalArgumentException- if the input string isNULLor emptyParseException- when invalid version string is providedUnexpectedCharacterException- is a special case ofParseException
-
interpret
Interprets the expression.- Specified by:
interpretin interfaceExpression- Parameters:
version- the version to interpret against- Returns:
- the result of the expression interpretation
-