Class ConditionEvaluationResult


  • @API(status=STABLE,
         since="5.0")
    public class ConditionEvaluationResult
    extends java.lang.Object
    The result of evaluating an ExecutionCondition.
    Since:
    5.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean enabled  
      private java.util.Optional<java.lang.String> reason  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ConditionEvaluationResult​(boolean enabled, java.lang.String reason)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ConditionEvaluationResult disabled​(java.lang.String reason)
      Factory for creating disabled results.
      static ConditionEvaluationResult disabled​(java.lang.String reason, java.lang.String customReason)
      Factory for creating disabled results with custom reasons added by the user.
      static ConditionEvaluationResult enabled​(java.lang.String reason)
      Factory for creating enabled results.
      java.util.Optional<java.lang.String> getReason()
      Get the reason why the container or test should be enabled or disabled, if available.
      boolean isDisabled()
      Whether the container or test should be disabled.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • enabled

        private final boolean enabled
      • reason

        private final java.util.Optional<java.lang.String> reason
    • Constructor Detail

      • ConditionEvaluationResult

        private ConditionEvaluationResult​(boolean enabled,
                                          java.lang.String reason)
    • Method Detail

      • enabled

        public static ConditionEvaluationResult enabled​(java.lang.String reason)
        Factory for creating enabled results.
        Parameters:
        reason - the reason why the container or test should be enabled
        Returns:
        an enabled ConditionEvaluationResult with the given reason
      • disabled

        public static ConditionEvaluationResult disabled​(java.lang.String reason)
        Factory for creating disabled results.
        Parameters:
        reason - the reason why the container or test should be disabled
        Returns:
        a disabled ConditionEvaluationResult with the given reason
      • disabled

        @API(status=STABLE,
             since="5.7")
        public static ConditionEvaluationResult disabled​(java.lang.String reason,
                                                         java.lang.String customReason)
        Factory for creating disabled results with custom reasons added by the user.
        Parameters:
        reason - the default reason why the container or test should be disabled
        customReason - the custom reason why the container or test should be disabled
        Returns:
        a disabled ConditionEvaluationResult with the given reasons
        Since:
        5.7
      • isDisabled

        public boolean isDisabled()
        Whether the container or test should be disabled.
        Returns:
        true if the container or test should be disabled
      • getReason

        public java.util.Optional<java.lang.String> getReason()
        Get the reason why the container or test should be enabled or disabled, if available.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object