Class Argcheck

java.lang.Object
fc.util.Argcheck

public final class Argcheck extends Object
This class is intended primarily for checking whether method paramaters meet various pre-conditions. Throws a IllegalArgumentException in case of failure.

ThreadSafety: This class is thread safe and can be used by multiple threads concurrently.

Version:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Checks that the specified arguments are equal to each other by using Object.equals().
    static void
    isequal(Object a, Object b, String message)
    Checks that the specified arguments are equal to each other by using Object.equals().
    static void
    isfalse(boolean val)
    Checks that the specified argument is false.
    static void
    isfalse(boolean val, String message)
    Checks that the specified argument is false.
    static void
    Checks that the specified argument is null.
    static void
    isnull(Object obj, String message)
    Checks that the specified argument is null.
    static void
    Checks to see if specified objects are the same object, that is, the references are identical.
    static void
    issame(Object a, Object b, String message)
    Checks to see if specified objects are the same object, that is, the references are identical.
    static void
    istrue(boolean val)
    Checks that the specified argument is true.
    static void
    istrue(boolean val, String message)
    Checks that the specified argument is true.
    static void
    main(String[] args)
     
    static void
    Checks that the specified arguments are not equal to each other by using Object.equals().
    static void
    notequal(Object a, Object b, String message)
    Checks that the specified arguments are not equal to each other by using Object.equals().
    static void
    Checks that the specified argument is not null.
    static void
    notnull(Object obj, String message)
    Checks that the specified argument is not null.
    static void
    Checks to see if specified objects are not the same object, that is, the references are not identical.
    static void
    notsame(Object a, Object b, String message)
    Checks to see if specified objects are not the same object, that is, the references are not identical.
    static boolean
    Sets a different error handler.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isfalse

      public static void isfalse(boolean val)
      Checks that the specified argument is false.
      Parameters:
      val - value to be tested
    • isfalse

      public static void isfalse(boolean val, String message)
      Checks that the specified argument is false.
      Parameters:
      val - value to be tested
      message - message for the exception
    • istrue

      public static void istrue(boolean val)
      Checks that the specified argument is true.
      Parameters:
      val - value to be tested
    • istrue

      public static void istrue(boolean val, String message)
      Checks that the specified argument is true.
      Parameters:
      val - value to be tested
      message - message for the exception
    • notnull

      public static void notnull(Object obj)
      Checks that the specified argument is not null.
      Parameters:
      obj - value to be tested
    • notnull

      public static void notnull(Object obj, String message)
      Checks that the specified argument is not null.
      Parameters:
      obj - value to be tested
      message - message for the exception
    • isnull

      public static void isnull(Object obj)
      Checks that the specified argument is null.
      Parameters:
      obj - value to be tested
    • isnull

      public static void isnull(Object obj, String message)
      Checks that the specified argument is null.
      Parameters:
      obj - value to be tested
      message - message for the exception
    • isequal

      public static void isequal(Object a, Object b)
      Checks that the specified arguments are equal to each other by using Object.equals().
      Parameters:
      a - first value to be tested
      b - second value to be tested
    • isequal

      public static void isequal(Object a, Object b, String message)
      Checks that the specified arguments are equal to each other by using Object.equals().
      Parameters:
      a - first value to be tested
      b - second value to be tested
      message - message message for the exception
    • notequal

      public static void notequal(Object a, Object b)
      Checks that the specified arguments are not equal to each other by using Object.equals().
      Parameters:
      a - first value to be tested
      b - second value to be tested
    • notequal

      public static void notequal(Object a, Object b, String message)
      Checks that the specified arguments are not equal to each other by using Object.equals().
      Parameters:
      a - first value to be tested
      b - second value to be tested
      message - message message for the exception
    • issame

      public static void issame(Object a, Object b)
      Checks to see if specified objects are the same object, that is, the references are identical. This provides a stronger notion of equality than the Object.equals() method.
      Parameters:
      a - first value to be tested
      b - second value to be tested
    • issame

      public static void issame(Object a, Object b, String message)
      Checks to see if specified objects are the same object, that is, the references are identical. This provides a stronger notion of equality than the Object.equals() method.
      Parameters:
      a - first value to be tested
      b - second value to be tested
      message - message message for the exception
    • notsame

      public static void notsame(Object a, Object b)
      Checks to see if specified objects are not the same object, that is, the references are not identical.
      Parameters:
      a - first value to be tested
      b - second value to be tested
    • notsame

      public static void notsame(Object a, Object b, String message)
      Checks to see if specified objects are not the same object, that is, the references are not identical.
      Parameters:
      a - first value to be tested
      b - second value to be tested
      message - message message for the exception
    • setHandler

      public static boolean setHandler(IArgcheckFailHandler thehandler)
      Sets a different error handler.
      Parameters:
      thehandler - the new error handler
      Returns:
      true is successful, false otherwise
    • main

      public static void main(String[] args)