Class ToggeableCondition

java.lang.Object
io.micronaut.objectstorage.configuration.ToggeableCondition
All Implemented Interfaces:
io.micronaut.context.condition.Condition, Predicate<io.micronaut.context.condition.ConditionContext>

@Internal public class ToggeableCondition extends Object implements io.micronaut.context.condition.Condition
Condition to check whether a bean should be enabled based on Toggleable configuration.
Since:
2.0.2
Author:
Álvaro Sánchez-Mariscal
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    matches(@NonNull io.micronaut.context.condition.ConditionContext<?> context, @NonNull Class<? extends io.micronaut.core.util.Toggleable> configurationClass)
    Check whether a specific condition is met.
    boolean
    matches(io.micronaut.context.condition.ConditionContext context)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.context.condition.Condition

    test

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Constructor Details

    • ToggeableCondition

      public ToggeableCondition()
  • Method Details

    • matches

      public boolean matches(io.micronaut.context.condition.ConditionContext context)
      Specified by:
      matches in interface io.micronaut.context.condition.Condition
    • matches

      public static boolean matches(@NonNull @NonNull io.micronaut.context.condition.ConditionContext<?> context, @NonNull @NonNull Class<? extends io.micronaut.core.util.Toggleable> configurationClass)
      Check whether a specific condition is met.
      Parameters:
      context - The condition context
      configurationClass - A Toggleable configuration class.
      Returns:
      True if has been met