org.richfaces.fragment.common

## Class Validate

- java.lang.Object
- - org.richfaces.fragment.common.Validate

-     public final class Validate
      extends Object

  Author:
    Lukas Fryc

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `isTrue(boolean expression, String message, Object... messageArguments)` Validate that the argument condition is `true`; otherwise throwing an exception with the specified message.

    - ### Methods inherited from class java.lang.Object

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

- - ### Method Detail

    - #### isTrue

          public static void isTrue(boolean expression,
                    String message,
                    Object... messageArguments)

      Validate that the argument condition is `true`; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary boolean expression, such as validating a primitive number or using your own custom validation expression.

          Validate.isTrue(i > 0.0, "The value must be greater than zero: %d", i);

      For performance reasons, the long value is passed as a separate parameter and appended to the exception message only in the case of an error.

      Parameters:
        `expression` - the boolean expression to check
        `message` - the `String.format(String, Object...)` exception message if invalid, not null
        `messageArguments` - the arguments for formatting the message when invalid
      Throws:
        `IllegalArgumentException` - if expression is `false`

Copyright © 2015 JBoss by Red Hat. All Rights Reserved.