Package art.cutils.function
Interface Condition
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Condition
Represents an operation that returns a condition/boolean. whose functional method isisMet()
.- Since:
- 1.0
- Author:
- , Bobai Kato
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static @NotNull Condition
allMet(Condition... conditions)
Verifies that all conditions are met.default Condition
and(Condition other)
Returns a composed condition that represents a short-circuiting logical AND of this conditionstatic @NotNull Condition
anyMet(Condition @NotNull ... conditions)
Verifies that at least one condition is met.boolean
isMet()
Check the condition.default boolean
isNotMet()
Negates the condition.default Condition
nand(Condition other)
Returns a composed condition that represents a short-circuiting logical NAND of this conditionstatic @NotNull Condition
noneMet(Condition @NotNull ... conditions)
Verifies that none of the conditions are met.default Condition
nor(Condition other)
Returns a composed condition that represents a short-circuiting logical NOR of this conditionstatic @NotNull Condition
of(boolean value)
Returns aCondition
of the boolean value.default Condition
or(Condition other)
Returns a composed condition that represents a short-circuiting logical OR of this conditiondefault Condition
xnor(Condition other)
Returns a composed condition that represents a short-circuiting logical XNOR of this conditiondefault Condition
xor(Condition other)
Returns a composed condition that represents a short-circuiting logical XOR of this condition
-
-
-
Method Detail
-
allMet
@Contract(pure=true) @NotNull static @NotNull Condition allMet(Condition... conditions)
Verifies that all conditions are met.- Parameters:
conditions
- the conditions to verify that all are met- Returns:
- true if all conditions are met, false otherwise
-
anyMet
@Contract(pure=true) @NotNull static @NotNull Condition anyMet(Condition @NotNull ... conditions)
Verifies that at least one condition is met.- Parameters:
conditions
- the conditions to verify that at least one is met- Returns:
- true if at least one condition is met, false otherwise
-
noneMet
@Contract(pure=true) @NotNull static @NotNull Condition noneMet(Condition @NotNull ... conditions)
Verifies that none of the conditions are met.- Parameters:
conditions
- the conditions to verify that none are met- Returns:
- true if none of the conditions are met, false otherwise
-
of
@Contract(pure=true) @NotNull static @NotNull Condition of(boolean value)
Returns aCondition
of the boolean value.- Parameters:
value
- the boolean value- Returns:
- a
Condition
of the boolean value
-
isNotMet
default boolean isNotMet()
Negates the condition. True is condition isn't met and False when condition is met.- Returns:
- the negated condition.
- Since:
- 1.0
-
isMet
boolean isMet()
Check the condition.- Returns:
- the final condition of boolean
- Since:
- 1.0
-
and
default Condition and(Condition other)
Returns a composed condition that represents a short-circuiting logical AND of this condition- Parameters:
other
- a condition that will be logically-ANDed with this condition- Returns:
- a composed condition that represents the short-circuiting logical AND of this condition
-
or
default Condition or(Condition other)
Returns a composed condition that represents a short-circuiting logical OR of this condition- Parameters:
other
- a condition that will be logically-ORed with this condition- Returns:
- a composed condition that represents the short-circuiting logical OR of this condition
-
xor
default Condition xor(Condition other)
Returns a composed condition that represents a short-circuiting logical XOR of this condition- Parameters:
other
- a condition that will be logically-XORed with this condition- Returns:
- a composed condition that represents the short-circuiting logical XOR of this condition
-
nand
default Condition nand(Condition other)
Returns a composed condition that represents a short-circuiting logical NAND of this condition- Parameters:
other
- a condition that will be logically-NANDed with this condition- Returns:
- a composed condition that represents the short-circuiting logical NAND of this condition
-
nor
default Condition nor(Condition other)
Returns a composed condition that represents a short-circuiting logical NOR of this condition- Parameters:
other
- a condition that will be logically-NORed with this condition- Returns:
- a composed condition that represents the short-circuiting logical NOR of this condition
-
xnor
default Condition xnor(Condition other)
Returns a composed condition that represents a short-circuiting logical XNOR of this condition- Parameters:
other
- a condition that will be logically-XNORed with this condition- Returns:
- a composed condition that represents the short-circuiting logical XNOR of this condition
-
-