Class ConditionMessage.Builder

java.lang.Object
org.springframework.boot.autoconfigure.condition.ConditionMessage.Builder
Enclosing class:
ConditionMessage

public final class ConditionMessage.Builder extends Object
Builder used to create a ConditionMessage for a condition.
  • Method Details

    • foundExactly

      public ConditionMessage foundExactly(Object result)
      Indicate that an exact result was found. For example foundExactly("foo") results in the message "found foo".
      Parameters:
      result - the result that was found
      Returns:
      a built ConditionMessage
    • found

      public ConditionMessage.ItemsBuilder found(String article)
      Indicate that one or more results were found. For example found("bean").items("x") results in the message "found bean x".
      Parameters:
      article - the article found
      Returns:
      an ConditionMessage.ItemsBuilder
    • found

      public ConditionMessage.ItemsBuilder found(String singular, String plural)
      Indicate that one or more results were found. For example found("bean", "beans").items("x", "y") results in the message "found beans x, y".
      Parameters:
      singular - the article found in singular form
      plural - the article found in plural form
      Returns:
      an ConditionMessage.ItemsBuilder
    • didNotFind

      public ConditionMessage.ItemsBuilder didNotFind(String article)
      Indicate that one or more results were not found. For example didNotFind("bean").items("x") results in the message "did not find bean x".
      Parameters:
      article - the article found
      Returns:
      an ConditionMessage.ItemsBuilder
    • didNotFind

      public ConditionMessage.ItemsBuilder didNotFind(String singular, String plural)
      Indicate that one or more results were found. For example didNotFind("bean", "beans").items("x", "y") results in the message "did not find beans x, y".
      Parameters:
      singular - the article found in singular form
      plural - the article found in plural form
      Returns:
      an ConditionMessage.ItemsBuilder
    • resultedIn

      public ConditionMessage resultedIn(Object result)
      Indicates a single result. For example resultedIn("yes") results in the message "resulted in yes".
      Parameters:
      result - the result
      Returns:
      a built ConditionMessage
    • available

      public ConditionMessage available(String item)
      Indicates something is available. For example available("money") results in the message "money is available".
      Parameters:
      item - the item that is available
      Returns:
      a built ConditionMessage
    • notAvailable

      public ConditionMessage notAvailable(String item)
      Indicates something is not available. For example notAvailable("time") results in the message "time is not available".
      Parameters:
      item - the item that is not available
      Returns:
      a built ConditionMessage
    • because

      public ConditionMessage because(String reason)
      Indicates the reason. For example because("running Linux") results in the message "running Linux".
      Parameters:
      reason - the reason for the message
      Returns:
      a built ConditionMessage