クラス Preconditions


  • public final class Preconditions
    extends Object
    The Preconditions provides a way to ensure the preconditions for arguments and data at the start of the process.

    Each of the features provided by the Preconditions validates for preconditions, and if the data being validated does not meet the preconditions, it will always throw an exception corresponding to the validation process.

    In addition, each validation method has an option that allows you to specify an arbitrary exception object or detailed message when an exception occurs, so you can validate preconditions according to the implementation of your application. The optional exception object must inherit from RuntimeException .

    If the data passed as an argument satisfies the specified preconditions, the validation method terminates without performing any processing other than checking.

     For example, here is an example of the following case where a non-empty string is required as a condition for starting a method:
     
     Preconditions.requireNonEmpty(null);
     >> NullPointerException
    
     Preconditions.requireNonEmpty("");
     >> PreconditionFailedException
     
    
     You can also specify arbitrary exception objects and detailed messages as follows:
     
     Preconditions.requireNonEmpty("", "any exception message");
     Preconditions.requireNonEmpty("", new AnyRuntimeException());
     Preconditions.requireNonEmpty("", new AnyRuntimeException("any exception message"));
     
     
    導入されたバージョン:
    1.0.0
    • メソッドの概要

      すべてのメソッド staticメソッド concreteメソッド 
      修飾子とタイプ メソッド 説明
      static void requireEndWith​(String string, String suffix)
      Ensures that the string specified as an argument ends with the suffix specified by suffix .
      static void requireEndWith​(String string, String suffix, RuntimeException exception)
      Ensures that the string specified as an argument ends with the suffix specified by suffix .
      static void requireEndWith​(String string, String suffix, String message)
      Ensures that the string specified as an argument ends with the suffix specified by suffix .
      static void requireFalse​(boolean bool)
      Ensures that the boolean value given as an argument is false .
      static void requireFalse​(boolean bool, RuntimeException exception)
      Ensures that the boolean value given as an argument is false .
      static void requireFalse​(boolean bool, String message)
      Ensures that the boolean value given as an argument is false .
      static void requireNegative​(byte number)
      Ensures that the argument number is a negative byte number.  
      static void requireNegative​(byte number, RuntimeException exception)
      Ensures that the argument number is a negative byte number. 
      static void requireNegative​(byte number, String message)
      Ensures that the argument number is a negative byte number. 
      static void requireNegative​(double number)
      Ensures that the argument number is a negative double number. 
      static void requireNegative​(double number, RuntimeException exception)
      Ensures that the argument number is a negative double number. 
      static void requireNegative​(double number, String message)
      Ensures that the argument number is a negative double number. 
      static void requireNegative​(float number)
      Ensures that the argument number is a negative float number. 
      static void requireNegative​(float number, RuntimeException exception)
      Ensures that the argument number is a negative float number. 
      static void requireNegative​(float number, String message)
      Ensures that the argument number is a negative float number. 
      static void requireNegative​(int number)
      Ensures that the argument number is a negative number. 
      static void requireNegative​(int number, RuntimeException exception)
      Ensures that the argument number is a negative number. 
      static void requireNegative​(int number, String message)
      Ensures that the argument number is a negative number. 
      static void requireNegative​(long number)
      Ensures that the argument number is a negative long number. 
      static void requireNegative​(long number, RuntimeException exception)
      Ensures that the argument number is a negative long number. 
      static void requireNegative​(long number, String message)
      Ensures that the argument number is a negative long number. 
      static void requireNegative​(short number)
      Ensures that the argument number is a negative short number. 
      static void requireNegative​(short number, RuntimeException exception)
      Ensures that the argument number is a negative short number. 
      static void requireNegative​(short number, String message)
      Ensures that the argument number is a negative short number. 
      static void requireNonBlank​(String string)
      Ensures that the string of the string object given as an argument is not an empty string. 
      static void requireNonBlank​(String string, RuntimeException exception)
      Ensures that string given as an argument is not an empty string. 
      static void requireNonBlank​(String string, String message)
      Ensures that the string of the string object given as an argument is not an empty string. 
      static void requireNonEmpty​(Object[] array)
      Ensures that the array passed as an argument is not null or an empty array. 
      static void requireNonEmpty​(Object[] array, RuntimeException exception)
      Ensures that the array passed as a number is not null or an empty array. 
      static void requireNonEmpty​(Object[] array, String message)
      Ensures that the array passed as an argument is not null or an empty array. 
      static void requireNonEmpty​(String string)
      Ensures that the reference to the string object specified as an argument is not null or the string is not an empty string. 
      static void requireNonEmpty​(String string, RuntimeException exception)
      Ensures that the value of string passed as an argument is not null or an empty string. 
      static void requireNonEmpty​(String string, String message)
      Ensures that the reference to the string object specified as an argument is not null or the string is not an empty string. 
      static void requireNonEmpty​(List<?> list)
      Ensures that list passed as an argument is not null or an empty list. 
      static void requireNonEmpty​(List<?> list, RuntimeException exception)
      Ensures that list given as an argument is not null or an empty list. 
      static void requireNonEmpty​(List<?> list, String message)
      Ensures that list passed as an argument is not null or an empty list. 
      static void requireNonEmpty​(Map<?,​?> map)
      Ensures that map passed as an argument is not null or an empty map. 
      static void requireNonEmpty​(Map<?,​?> map, RuntimeException exception)
      Ensures that map passed as an argument is not null or an empty map. 
      static void requireNonEmpty​(Map<?,​?> map, String message)
      Ensures that map passed as an argument is not null or an empty map. 
      static void requireNonEmpty​(Set<?> set)
      Ensures that set passed as an argument is not null or an empty set. 
      static void requireNonEmpty​(Set<?> set, RuntimeException exception)
      Ensures that set passed as an argument is not null or an empty set. 
      static void requireNonEmpty​(Set<?> set, String message)
      Ensures that set passed as an argument is not null or an empty set. 
      static void requireNonNull​(Object object)
      Ensures that the reference to the object object passed as an argument is not null
      static void requireNonNull​(Object object, RuntimeException exception)
      Ensures that the reference to the object object passed as an argument is not null
      static void requireNonNull​(Object object, String message)
      Ensures that the reference to the object object passed as an argument is not null .  
      static void requirePositive​(byte number)
      Ensures that the number argument is a positive byte number. 
      static void requirePositive​(byte number, RuntimeException exception)
      Ensures that the number argument is a positive byte number. 
      static void requirePositive​(byte number, String message)
      Ensures that the number argument is a positive byte number. 
      static void requirePositive​(double number)
      Ensures that the number argument is a positive double number. 
      static void requirePositive​(double number, RuntimeException exception)
      Ensures that the number argument is a positive double number. 
      static void requirePositive​(double number, String message)
      Ensures that the number argument is a positive double number. 
      static void requirePositive​(float number)
      Ensures that the number argument is a positive float number.  
      static void requirePositive​(float number, RuntimeException exception)
      Ensures that the number argument is a positive float number.  
      static void requirePositive​(float number, String message)
      Ensures that the number argument is a positive float number. 
      static void requirePositive​(int number)
      Ensures that the number argument is a positive number. 
      static void requirePositive​(int number, RuntimeException exception)
      Ensures that the number argument is a positive number. 
      static void requirePositive​(int number, String message)
      Ensures that the number argument is a positive number. 
      static void requirePositive​(long number)
      Ensures that the number argument is a positive long number. 
      static void requirePositive​(long number, RuntimeException exception)
      Ensures that the number argument is a positive long number. 
      static void requirePositive​(long number, String message)
      Ensures that the number argument is a positive long number. 
      static void requirePositive​(short number)
      Ensures that the number argument is a positive short number. 
      static void requirePositive​(short number, RuntimeException exception)
      Ensures that the number argument is a positive short number. 
      static void requirePositive​(short number, String message)
      Ensures that the number argument is a positive short number. 
      static void requireRange​(byte index, byte from, byte to)
      Ensures that the byte index argument is within the range specified by from to to
      static void requireRange​(byte index, byte from, byte to, RuntimeException exception)
      Ensures that the byte index argument is within the range specified by from to to
      static void requireRange​(byte index, byte from, byte to, String message)
      Ensures that the byte index argument is within the range specified by from to to
      static void requireRange​(double index, double from, double to)
      Ensures that the double index argument is within the range specified by from to to .  
      static void requireRange​(double index, double from, double to, RuntimeException exception)
      Ensures that the double index argument is within the range specified by from to to
      static void requireRange​(double index, double from, double to, String message)
      Ensures that the double index argument is within the range specified by from to to
      static void requireRange​(float index, float from, float to)
      Ensures that the float index argument is within the range specified by from to to
      static void requireRange​(float index, float from, float to, RuntimeException exception)
      Ensures that the float index argument is within the range specified by from to to
      static void requireRange​(float index, float from, float to, String message)
      Ensures that the float index argument is within the range specified by from to to
      static void requireRange​(int index, int from, int to)
      Ensures that the index argument is within the range specified by from to to
      static void requireRange​(int index, int from, int to, RuntimeException exception)
      Ensures that the index argument is within the range specified by from to to
      static void requireRange​(int index, int from, int to, String message)
      Ensures that the index argument is within the range specified by from to to
      static void requireRange​(long index, long from, long to)
      Ensures that the long index argument is within the range specified by from to to
      static void requireRange​(long index, long from, long to, RuntimeException exception)
      Ensures that the long index argument is within the range specified by from to to
      static void requireRange​(long index, long from, long to, String message)
      Ensures that the long index argument is within the range specified by from to to
      static void requireRange​(short index, short from, short to)
      Ensures that the short index argument is within the range specified by from to to
      static void requireRange​(short index, short from, short to, RuntimeException exception)
      Ensures that the short index argument is within the range specified by from to to
      static void requireRange​(short index, short from, short to, String message)
      Ensures that the short index argument is within the range specified by from to to
      static void requireRangeFrom​(byte index, byte from)
      Ensures that the byte index argument is a number within the range specified by from
      static void requireRangeFrom​(byte index, byte from, RuntimeException exception)
      Ensures that the byte index argument is a number within the range specified by from
      static void requireRangeFrom​(byte index, byte from, String message)
      Ensures that the byte index argument is a number within the range specified by from
      static void requireRangeFrom​(double index, double from)
      Ensures that the double index argument is a number within the range specified by from
      static void requireRangeFrom​(double index, double from, RuntimeException exception)
      Ensures that the double index argument is a number within the range specified by from
      static void requireRangeFrom​(double index, double from, String message)
      Ensures that the double index argument is a number within the range specified by from
      static void requireRangeFrom​(float index, float from)
      Ensures that the float index argument is a number within the range specified by from
      static void requireRangeFrom​(float index, float from, RuntimeException exception)
      Ensures that the float index argument is a number within the range specified by from
      static void requireRangeFrom​(float index, float from, String message)
      Ensures that the float index argument is a number within the range specified by from
      static void requireRangeFrom​(int index, int from)
      Ensures that the index argument is a number within the range specified by from
      static void requireRangeFrom​(int index, int from, RuntimeException exception)
      Ensures that the index argument is a number within the range specified by from
      static void requireRangeFrom​(int index, int from, String message)
      Ensures that the index argument is a number within the range specified by from
      static void requireRangeFrom​(long index, long from)
      Ensures that the long index argument is a number within the range specified by from
      static void requireRangeFrom​(long index, long from, RuntimeException exception)
      Ensures that the long index argument is a number within the range specified by from
      static void requireRangeFrom​(long index, long from, String message)
      Ensures that the long index argument is a number within the range specified by from
      static void requireRangeFrom​(short index, short from)
      Ensures that the short index argument is a number within the range specified by from
      static void requireRangeFrom​(short index, short from, RuntimeException exception)
      Ensures that the short index argument is a number within the range specified by from
      static void requireRangeFrom​(short index, short from, String message)
      Ensures that the short index argument is a number within the range specified by from
      static void requireRangeTo​(byte index, byte to)
      Ensures that the byte index argument is a number within the range specified by to
      static void requireRangeTo​(byte index, byte to, RuntimeException exception)
      Ensures that the byte index argument is a number within the range specified by to
      static void requireRangeTo​(byte index, byte to, String message)
      Ensures that the byte index argument is a number within the range specified by to
      static void requireRangeTo​(double index, double to)
      Ensures that the double index argument is a number within the range specified by to
      static void requireRangeTo​(double index, double to, RuntimeException exception)
      Ensures that the double index argument is a number within the range specified by to
      static void requireRangeTo​(double index, double to, String message)
      Ensures that the double index argument is a number within the range specified by to
      static void requireRangeTo​(float index, float to)
      Ensures that the float index argument is a number within the range specified by to
      static void requireRangeTo​(float index, float to, RuntimeException exception)
      Ensures that the float index argument is a number within the range specified by to
      static void requireRangeTo​(float index, float to, String message)
      Ensures that the float index argument is a number within the range specified by to
      static void requireRangeTo​(int index, int to)
      Ensures that the index argument is a number within the range specified by to
      static void requireRangeTo​(int index, int to, RuntimeException exception)
      Ensures that the index argument is a number within the range specified by to
      static void requireRangeTo​(int index, int to, String message)
      Ensures that the index argument is a number within the range specified by to
      static void requireRangeTo​(long index, long to)
      Ensures that the long index argument is a number within the range specified by to
      static void requireRangeTo​(long index, long to, RuntimeException exception)
      Ensures that the long index argument is a number within the range specified by to
      static void requireRangeTo​(long index, long to, String message)
      Ensures that the long index argument is a number within the range specified by to
      static void requireRangeTo​(short index, short to)
      Ensures that the short index argument is a number within the range specified by to
      static void requireRangeTo​(short index, short to, RuntimeException exception)
      Ensures that the short index argument is a number within the range specified by to
      static void requireRangeTo​(short index, short to, String message)
      Ensures that the short index argument is a number within the range specified by to
      static void requireStartWith​(String string, String prefix)
      Ensures that a given string begins with the prefix specified by prefix .
      static void requireStartWith​(String string, String prefix, int offset)
      Ensures that the argument starts with the prefix specified by prefix at the specified search start point.
      static void requireStartWith​(String string, String prefix, int offset, RuntimeException exception)
      Ensures that the argument starts with the prefix specified by prefix at the specified search start point.
      static void requireStartWith​(String string, String prefix, int offset, String message)
      Ensures that the argument starts with the prefix specified by prefix at the specified search start point.
      static void requireStartWith​(String string, String prefix, RuntimeException exception)
      Ensures that a given string begins with the prefix specified by prefix .
      static void requireStartWith​(String string, String prefix, String message)
      Ensures that a given string begins with the prefix specified by prefix .
      static void requireTrue​(boolean bool)
      Ensures that the boolean value given as an argument is true .
      static void requireTrue​(boolean bool, RuntimeException exception)
      Ensures that the boolean value given as an argument is true .
      static void requireTrue​(boolean bool, String message)
      Ensures that the boolean value given as an argument is true .
    • メソッドの詳細

      • requireNonNull

        public static void requireNonNull​(Object object)
        Ensures that the reference to the object object passed as an argument is not null

        NullPointerException is always raised at runtime if the reference to the object object is null .

        Use the requireNonNull(Object, String) method if you want to print an arbitrary detailed message when an exception is raised.

         If the object passed as an argument is null, NullPointerException will be thrown.
         
         Preconditions.requireNonNull(null);
         >> NullPointerException
         
         
         If the object passed as an argument is not null, it does nothing and ends the validation process.
         
         Preconditions.requireNonNull("test");
         
         
        パラメータ:
        object - Object to be validated
        例外:
        NullPointerException - If object passed as an argument is null
      • requireNonNull

        public static void requireNonNull​(Object object,
                                          String message)
        Ensures that the reference to the object object passed as an argument is not null .  

        If the object object is referenced by null , then NullPointerException is always raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

         If the object passed as an argument is null, NullPointerException will be thrown.
         The message passed as an argument will be printed as a detailed message when an exception occurs.
         
         Preconditions.requireNonNull(null, "any message");
         >> NullPointerException
         
         
         If the object passed as an argument is not null, it does nothing and ends the validation process.
         
         Preconditions.requireNonNull("test", "any message");
         
         
        パラメータ:
        object - Object to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        NullPointerException - If object passed as an argument is null
      • requireNonNull

        public static void requireNonNull​(Object object,
                                          RuntimeException exception)
        Ensures that the reference to the object object passed as an argument is not null

        If the reference to a object object is null , any exception object specified as an argument will be thrown.

         If the object passed as an argument is null, then any exception object specified as an argument will be thrown.
         
         Preconditions.requireNonNull(null, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the object passed as an argument is not null, it does nothing and ends the validation process.
         
         Preconditions.requireNonNull("test", new AnyRuntimeException());
         
         
        パラメータ:
        object - Object to be validated
        exception - Any exception object that is thrown if the preconditions are not met
      • requireNonBlank

        public static void requireNonBlank​(String string)
        Ensures that the string of the string object given as an argument is not an empty string. 

        PreconditionFailedException is always raised at runtime if the string of the string object is an empty string.

        Use the requireNonEmpty(String) method if a reference to a string object specified as an argument is likely to be null .

        Use the requireNonBlank(String, String) method if you want to print out an arbitrary detailed message when an exception is thrown. Also, to throw an arbitrary exception object when an exception is thrown, use the requireNonBlank(String, RuntimeException) method.

         PreconditionFailedException will be thrown if the argument passed to string is an empty string.
         
         Preconditions.requireNonBlank("");
         >> PreconditionFailedException
         
         
         If the argument string is not an empty string, the function does nothing and ends the validation process.
         
         Preconditions.requireNonBlank("test");
         
         
        パラメータ:
        string - The string to be validated
        例外:
        NullPointerException - If null is passed as an argument
        PreconditionFailedException - If an empty string is passed as an argument
      • requireNonBlank

        public static void requireNonBlank​(String string,
                                           String message)
        Ensures that the string of the string object given as an argument is not an empty string. 

        If the string of a string object is an empty string, PreconditionFailedException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        Use the requireNonEmpty(String) method if a reference to a string object specified as an argument is likely to be null .

         PreconditionFailedException will be thrown if the argument passed to string is an empty string.
         A message passed as an argument will be printed as a detailed message when an exception occurs.
         
         Preconditions.requireNonBlank("", "any message");
         >> PreconditionFailedException
         
         
         If the argument string is not an empty string, the function does nothing and ends the validation process.
         
         Preconditions.requireNonBlank("test", "any message");
         
         
        パラメータ:
        string - The string to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        NullPointerException - If null is passed as an argument
        PreconditionFailedException - If an empty string is passed as an argument
      • requireNonBlank

        public static void requireNonBlank​(String string,
                                           RuntimeException exception)
        Ensures that string given as an argument is not an empty string. 

        Throws an exception object if the argument string is an empty string. If you do not specify any exceptions, use the requireNonBlank(String) method.

         If the argument string is an empty string, any exception object specified as an argument will be thrown.
         
         Preconditions.requireNonBlank("", new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the argument string is not an empty string, the function does nothing and ends the validation process.
         
         Preconditions.requireNonBlank("test", new AnyRuntimeException());
         
         
        パラメータ:
        string - The string to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If executed by the requireNonBlank(String) method and the string passed as an argument is an empty string
      • requireNonEmpty

        public static void requireNonEmpty​(String string)
        Ensures that the reference to the string object specified as an argument is not null or the string is not an empty string. 

        NullPointerException is always raised at runtime if the reference to a string object is null . And PreconditionFailedException is always raised at runtime if the string of the string object is an empty string.

        To specify an arbitrary exception object, use the requireNonEmpty(String, RuntimeException) method.

         NullPointerException will be thrown if the argument passed to string is null.
         
         Preconditions.requireNonEmpty(null);
         >> NullPointerException
         
         
         PreconditionFailedException will be thrown if the argument passed to string is an empty string.
         
         Preconditions.requireNonEmpty("");
         >> PreconditionFailedException
         
         
         If the argument string is not null and is not an empty string, it does nothing and ends the validation process.
         
         Preconditions.requireNonEmpty("test");
         
         
        パラメータ:
        string - The string to be validated
        例外:
        NullPointerException - If null is passed as an argument
        PreconditionFailedException - If an empty string is passed as an argument
      • requireNonEmpty

        public static void requireNonEmpty​(String string,
                                           String message)
        Ensures that the reference to the string object specified as an argument is not null or the string is not an empty string. 

        If the string object is referenced by null , then NullPointerException is always raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        If the string of a string object is an empty string, PreconditionFailedException is always raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireNonEmpty(String, RuntimeException) method.

         If the string argument is null, NullPointerException will be thrown.
         A message passed as an argument will be printed as a detailed message if an exception is raised.
         
         Preconditions.requireNonEmpty(null, "any message");
         >> NullPointerException
         
         
         PreconditionFailedException will be thrown if the argument passed to string is an empty string.
         A message passed as an argument will be printed as a detailed message when an exception occurs.
         
         Preconditions.requireNonEmpty("", "any message");
         >> PreconditionFailedException
         
         
         If the argument string is not null and is not an empty string, it does nothing and ends the validation process.
         
         Preconditions.requireNonEmpty("test", "any message");
         
         
        パラメータ:
        string - The string to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        NullPointerException - If null is passed as an argument
        PreconditionFailedException - If an empty string is passed as an argument
      • requireNonEmpty

        public static void requireNonEmpty​(String string,
                                           RuntimeException exception)
        Ensures that the value of string passed as an argument is not null or an empty string. 

        Throws an exception if it is null or an empty string. If you do not specify an arbitrary exception object, use the requireNonEmpty(String) method.

         NullPointerException will be thrown if the argument passed to string is null.
         
         Preconditions.requireNonEmpty(null, new AnyRuntimeException());
         >> NullPointerException
         
         
         If the argument string is an empty string, any exception object specified as an argument will be thrown.
         
         Preconditions.requireNonEmpty("", new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the argument string is not null and is not an empty string, it does nothing and ends the validation process.
         
         Preconditions.requireNonEmpty("test", new AnyRuntimeException());
         
         
        パラメータ:
        string - The string to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null or if the string passed as an argument is null
        PreconditionFailedException - If string passed as an argument is an empty string
      • requirePositive

        public static void requirePositive​(int number)
        Ensures that the number argument is a positive number. 

        If the argument number is negative, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requirePositive(int, RuntimeException) method.

         PreconditionFailedException will be thrown if the number passed as an argument is negative.
         
         Preconditions.requirePositive(-1);
         >> PreconditionFailedException
         
         
         If the number passed as a number is positive, it does nothing and ends the validation process.
         
         Preconditions.requirePositive(0);
         
         
        パラメータ:
        number - The number to be validated
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(int number,
                                           String message)
        Ensures that the number argument is a positive number. 

        If the argument number is negative, PreconditionFailedException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requirePositive(int, RuntimeException) method.

         If the argument number is negative PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         Preconditions.requirePositive(-1, "any message");
         >> PreconditionFailedException
         
         
         If the number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         Preconditions.requirePositive(0, "any message");
         
         
        パラメータ:
        number - The number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(int number,
                                           RuntimeException exception)
        Ensures that the number argument is a positive number. 

        If you do not specify an arbitrary exception object, use the requirePositive(int) method.

         If the number passed as an argument is negative, then any exception object specified as an argument will be thrown.
         
         Preconditions.requirePositive(-1, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         Preconditions.requirePositive(0, new AnyRuntimeException());
         
         
        パラメータ:
        number - The number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the specified number is negative
      • requirePositive

        public static void requirePositive​(long number)
        Ensures that the number argument is a positive long number. 

        If the argument number is negative, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requirePositive(long, RuntimeException) method.

         PreconditionFailedException will be thrown if the long number passed as an argument is negative.
         
         Preconditions.requirePositive(-1L);
         >> PreconditionFailedException
         
         
         If the long number passed as a number is positive, it does nothing and ends the validation process.
         
         Preconditions.requirePositive(0L);
         
         
        パラメータ:
        number - The long number to be validated
        例外:
        PreconditionFailedException - If the long number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(long number,
                                           String message)
        Ensures that the number argument is a positive long number. 

        If the argument number is negative, PreconditionFailedException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requirePositive(long, RuntimeException) method.

         If the argument long number is negative PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         Preconditions.requirePositive(-1L, "any message");
         >> PreconditionFailedException
         
         
         If the long number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         Preconditions.requirePositive(0L, "any message");
         
         
        パラメータ:
        number - The long number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the long number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(long number,
                                           RuntimeException exception)
        Ensures that the number argument is a positive long number. 

        If you do not specify an arbitrary exception object, use the requirePositive(long) method.

         If the long number passed as an argument is negative, then any exception object specified as an argument will be thrown.
         
         Preconditions.requirePositive(-1L, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the long number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         Preconditions.requirePositive(0L, new AnyRuntimeException());
         
         
        パラメータ:
        number - The long number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the specified long number is negative
      • requirePositive

        public static void requirePositive​(short number)
        Ensures that the number argument is a positive short number. 

        If the argument number is negative, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requirePositive(short, RuntimeException) method.

         PreconditionFailedException will be thrown if the short number passed as an argument is negative.
         
         short number = -1;
         Preconditions.requirePositive(number);
         >> PreconditionFailedException
         
         
         If the short number passed as a number is positive, it does nothing and ends the validation process.
         
         short number = 0;
         Preconditions.requirePositive(number);
         
         
        パラメータ:
        number - The short number to be validated
        例外:
        PreconditionFailedException - If the short number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(short number,
                                           String message)
        Ensures that the number argument is a positive short number. 

        If the argument number is negative, PreconditionFailedException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requirePositive(short, RuntimeException) method.

         If the argument short number is negative PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         short number = -1;
         Preconditions.requirePositive(number, "any message");
         >> PreconditionFailedException
         
         
         If the short number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         short number = 0;
         Preconditions.requirePositive(number, "any message");
         
         
        パラメータ:
        number - The short number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the short number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(short number,
                                           RuntimeException exception)
        Ensures that the number argument is a positive short number. 

        If you do not specify an arbitrary exception object, use the requirePositive(short) method.

         If the short number passed as an argument is negative, then any exception object specified as an argument will be thrown.
         
         short number = -1;
         Preconditions.requirePositive(number, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the short number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         short number = 0;
         Preconditions.requirePositive(number, new AnyRuntimeException());
         
         
        パラメータ:
        number - The short number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the specified short number is negative
      • requirePositive

        public static void requirePositive​(byte number)
        Ensures that the number argument is a positive byte number. 

        If the argument number is negative, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requirePositive(byte, RuntimeException) method.

         PreconditionFailedException will be thrown if the byte number passed as an argument is negative.
         
         byte number = -1;
         Preconditions.requirePositive(number);
         >> PreconditionFailedException
         
         
         If the byte number passed as a number is positive, it does nothing and ends the validation process.
         
         byte number = 0;
         Preconditions.requirePositive(number);
         
         
        パラメータ:
        number - The byte number to be validated
        例外:
        PreconditionFailedException - If the byte number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(byte number,
                                           String message)
        Ensures that the number argument is a positive byte number. 

        If the argument number is negative, PreconditionFailedException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requirePositive(byte, RuntimeException) method.

         If the argument byte number is negative PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         byte number = -1;
         Preconditions.requirePositive(number, "any message");
         >> PreconditionFailedException
         
         
         If the byte number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         byte number = 0;
         Preconditions.requirePositive(number, "any message");
         
         
        パラメータ:
        number - The byte number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the byte number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(byte number,
                                           RuntimeException exception)
        Ensures that the number argument is a positive byte number. 

        If you do not specify an arbitrary exception object, use the requirePositive(byte) method.

         If the byte number passed as an argument is negative, then any exception object specified as an argument will be thrown.
         
         byte number = -1;
         Preconditions.requirePositive(number, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the byte number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         byte number = 0;
         Preconditions.requirePositive(number, new AnyRuntimeException());
         
         
        パラメータ:
        number - The byte number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the specified byte number is negative
      • requirePositive

        public static void requirePositive​(float number)
        Ensures that the number argument is a positive float number.  

        If the argument number is negative, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requirePositive(float, RuntimeException) method.

         PreconditionFailedException will be thrown if the float number passed as an argument is negative.
         
         Preconditions.requirePositive(-1.0f);
         >> PreconditionFailedException
         
         
         If the float number passed as a number is positive, it does nothing and ends the validation process.
         
         Preconditions.requirePositive(0.0f);
         
         
        パラメータ:
        number - The float number to be validated
        例外:
        PreconditionFailedException - If the float number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(float number,
                                           String message)
        Ensures that the number argument is a positive float number. 

        If the argument number is negative, PreconditionFailedException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requirePositive(float, RuntimeException) method.

         If the argument float number is negative PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         Preconditions.requirePositive(-1.0f, "any message");
         >> PreconditionFailedException
         
         
         If the float number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         Preconditions.requirePositive(0.0f, "any message");
         
         
        パラメータ:
        number - The float number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the float number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(float number,
                                           RuntimeException exception)
        Ensures that the number argument is a positive float number.  

        If you do not specify an arbitrary exception object, use the requirePositive(float) method.

         If the float number passed as an argument is negative, then any exception object specified as an argument will be thrown.
         
         Preconditions.requirePositive(-1.0f, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the float number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         Preconditions.requirePositive(0.0f, new AnyRuntimeException());
         
         
        パラメータ:
        number - The float number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the specified float number is negative
      • requirePositive

        public static void requirePositive​(double number)
        Ensures that the number argument is a positive double number. 

        If the argument number is negative, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requirePositive(double, RuntimeException) method.

         PreconditionFailedException will be thrown if the double number passed as an argument is negative.
         
         Preconditions.requirePositive(-1.0d);
         >> PreconditionFailedException
         
         
         If the double number passed as a number is positive, it does nothing and ends the validation process.
         
         Preconditions.requirePositive(0.0f);
         
         
        パラメータ:
        number - The double number to be validated
        例外:
        PreconditionFailedException - If the double number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(double number,
                                           String message)
        Ensures that the number argument is a positive double number. 

        If the argument number is negative, PreconditionFailedException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requirePositive(double, RuntimeException) method.

         If the argument double number is negative PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         Preconditions.requirePositive(-1.0d, "any message");
         >> PreconditionFailedException
         
         
         If the double number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         Preconditions.requirePositive(0.0d, "any message");
         
         
        パラメータ:
        number - The double number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the double number of number specified as an argument is a negative number
      • requirePositive

        public static void requirePositive​(double number,
                                           RuntimeException exception)
        Ensures that the number argument is a positive double number. 

        If you do not specify an arbitrary exception object, use the requirePositive(double) method.

         If the double number passed as an argument is negative, then any exception object specified as an argument will be thrown.
         
         Preconditions.requirePositive(-1.0d, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the double number passed as an argument is a positive number, it does nothing and exits the validation process.
         
         Preconditions.requirePositive(0.0d, new AnyRuntimeException());
         
         
        パラメータ:
        number - The double number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the specified double number is negative
      • requireNegative

        public static void requireNegative​(int number)
        Ensures that the argument number is a negative number. 

        If the argument number is positive, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requireNegative(int, RuntimeException) method.

         PreconditionFailedException will be thrown if the number passed as an argument is positive.
         
         Preconditions.requireNegative(0);
         >> PreconditionFailedException
         
         
         If number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1);
         
         
        パラメータ:
        number - The number to be validated
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive number
      • requireNegative

        public static void requireNegative​(int number,
                                           String message)
        Ensures that the argument number is a negative number. 

        If the argument number is a positive number, PreconditionFailedException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireNegative(int, RuntimeException) method.

         If the number argument is positive, PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         Preconditions.requireNegative(0, "any message");
         >> PreconditionFailedException
         
         
         If number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1, "any message");
         
         
        パラメータ:
        number - The number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive number
      • requireNegative

        public static void requireNegative​(int number,
                                           RuntimeException exception)
        Ensures that the argument number is a negative number. 

        If number is a positive number, throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireNegative(int) method.

         If the number passed as an argument is positive, any exception object specified as an argument will be thrown.
         
         Preconditions.requireNegative(0, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1, new AnyRuntimeException());
         
         
        パラメータ:
        number - The number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the value of the number passed as an argument is a positive number
      • requireNegative

        public static void requireNegative​(long number)
        Ensures that the argument number is a negative long number. 

        If the argument number is positive, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requireNegative(long, RuntimeException) method.

         PreconditionFailedException will be thrown if the long number passed as an argument is positive.
         
         Preconditions.requireNegative(0L);
         >> PreconditionFailedException
         
         
         If the long number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1L);
         
         
        パラメータ:
        number - The long number to be validated
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive long number
      • requireNegative

        public static void requireNegative​(long number,
                                           String message)
        Ensures that the argument number is a negative long number. 

        If the argument number is a positive number, PreconditionFailedException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireNegative(long, RuntimeException) method.

         If the long number argument is positive, PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         Preconditions.requireNegative(0L, "any message");
         >> PreconditionFailedException
         
         
         If the long number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1L, "any message");
         
         
        パラメータ:
        number - The long number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive long number
      • requireNegative

        public static void requireNegative​(long number,
                                           RuntimeException exception)
        Ensures that the argument number is a negative long number. 

        If number is a positive number, throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireNegative(long) method.

         If the long number passed as an argument is positive, any exception object specified as an argument will be thrown.
         
         Preconditions.requireNegative(0L, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the long number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1L, new AnyRuntimeException());
         
         
        パラメータ:
        number - The long number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the value of the number passed as an argument is a positive long number
      • requireNegative

        public static void requireNegative​(short number)
        Ensures that the argument number is a negative short number. 

        If the argument number is positive, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requireNegative(short, RuntimeException) method.

         PreconditionFailedException will be thrown if the short number passed as an argument is positive.
         
         short number = 0;
         Preconditions.requireNegative(number);
         >> PreconditionFailedException
         
         
         If the short number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         short number = -1;
         Preconditions.requireNegative(number);
         
         
        パラメータ:
        number - The short number to be validated
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive short number
      • requireNegative

        public static void requireNegative​(short number,
                                           String message)
        Ensures that the argument number is a negative short number. 

        If the argument number is a positive number, PreconditionFailedException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireNegative(short, RuntimeException) method.

         If the short number argument is positive, PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         short number = -1;
         Preconditions.requireNegative(number, "any message");
         >> PreconditionFailedException
         
         
         If the short number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         short number = -1;
         Preconditions.requireNegative(number, "any message");
         
         
        パラメータ:
        number - The short number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive short number
      • requireNegative

        public static void requireNegative​(short number,
                                           RuntimeException exception)
        Ensures that the argument number is a negative short number. 

        If number is a positive number, throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireNegative(short) method.

         If the short number passed as an argument is positive, any exception object specified as an argument will be thrown.
         
         short number = 0;
         Preconditions.requireNegative(number, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the short number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         short number = -1;
         Preconditions.requireNegative(number, new AnyRuntimeException());
         
         
        パラメータ:
        number - The short number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the value of the number passed as an argument is a positive short number
      • requireNegative

        public static void requireNegative​(byte number)
        Ensures that the argument number is a negative byte number.  

        If the argument number is positive, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requireNegative(byte, RuntimeException) method.

         PreconditionFailedException will be thrown if the byte number passed as an argument is positive.
         
         byte number = 0;
         Preconditions.requireNegative(number);
         >> PreconditionFailedException
         
         
         If the byte number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         byte number = -1;
         Preconditions.requireNegative(number);
         
         
        パラメータ:
        number - The byte number to be validated
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive byte number
      • requireNegative

        public static void requireNegative​(byte number,
                                           String message)
        Ensures that the argument number is a negative byte number. 

        If the argument number is a positive number, PreconditionFailedException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireNegative(byte, RuntimeException) method.

         If the byte number argument is positive, PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         byte number = -1;
         Preconditions.requireNegative(number, "any message");
         >> PreconditionFailedException
         
         
         If the byte number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         byte number = -1;
         Preconditions.requireNegative(number, "any message");
         
         
        パラメータ:
        number - The byte number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive byte number
      • requireNegative

        public static void requireNegative​(byte number,
                                           RuntimeException exception)
        Ensures that the argument number is a negative byte number. 

        If number is a positive number, throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireNegative(byte) method.

         If the byte number passed as an argument is positive, any exception object specified as an argument will be thrown.
         
         byte number = 0;
         Preconditions.requireNegative(number, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the byte number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         byte number = -1;
         Preconditions.requireNegative(number, new AnyRuntimeException());
         
         
        パラメータ:
        number - The byte number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the value of the number passed as an argument is a positive byte number
      • requireNegative

        public static void requireNegative​(float number)
        Ensures that the argument number is a negative float number. 

        If the argument number is positive, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requireNegative(float, RuntimeException) method.

         PreconditionFailedException will be thrown if the float number passed as an argument is positive.
         
         Preconditions.requireNegative(0.0f);
         >> PreconditionFailedException
         
         
         If the float number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1.0f);
         
         
        パラメータ:
        number - The float number to be validated
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive float number
      • requireNegative

        public static void requireNegative​(float number,
                                           String message)
        Ensures that the argument number is a negative float number. 

        If the argument number is a positive number, PreconditionFailedException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireNegative(float, RuntimeException) method.

         If the float number argument is positive, PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         Preconditions.requireNegative(0.0f, "any message");
         >> PreconditionFailedException
         
         
         If the float number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1.0f, "any message");
         
         
        パラメータ:
        number - The float number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive float number
      • requireNegative

        public static void requireNegative​(float number,
                                           RuntimeException exception)
        Ensures that the argument number is a negative float number. 

        If number is a positive number, throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireNegative(float) method.

         If the float number passed as an argument is positive, any exception object specified as an argument will be thrown.
         
         Preconditions.requireNegative(0.0f, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the float number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1.0f, new AnyRuntimeException());
         
         
        パラメータ:
        number - The float number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the value of the number passed as an argument is a positive float number
      • requireNegative

        public static void requireNegative​(double number)
        Ensures that the argument number is a negative double number. 

        If the argument number is positive, PreconditionFailedException is always raised at runtime.

        To specify an arbitrary exception object, use the requireNegative(double, RuntimeException) method.

         PreconditionFailedException will be thrown if the double number passed as an argument is positive.
         
         Preconditions.requireNegative(0.0d);
         >> PreconditionFailedException
         
         
         If the double number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1.0d);
         
         
        パラメータ:
        number - The double number to be validated
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive double number
      • requireNegative

        public static void requireNegative​(double number,
                                           String message)
        Ensures that the argument number is a negative double number. 

        If the argument number is a positive number, PreconditionFailedException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireNegative(double, RuntimeException) method.

         If the double number argument is positive, PreconditionFailedException will be thrown.
         The message passed as an argument will be output as a detailed message when an exception occurs.
         
         Preconditions.requireNegative(0.0d, "any message");
         >> PreconditionFailedException
         
         
         If the double number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1.0d, "any message");
         
         
        パラメータ:
        number - The double number to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the number of number specified as an argument is a positive double number
      • requireNegative

        public static void requireNegative​(double number,
                                           RuntimeException exception)
        Ensures that the argument number is a negative double number. 

        If number is a positive number, throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireNegative(double) method.

         If the double number passed as an argument is positive, any exception object specified as an argument will be thrown.
         
         Preconditions.requireNegative(0.0d, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the double number passed as an argument is a negative number, it does nothing and ends the validation process.
         
         Preconditions.requireNegative(-1.0d, new AnyRuntimeException());
         
         
        パラメータ:
        number - The double number to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        PreconditionFailedException - If the value of the number passed as an argument is a positive double number
      • requireRangeFrom

        public static void requireRangeFrom​(int index,
                                            int from)
        Ensures that the index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeFrom(int, int, RuntimeException) method.

         If the index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         
         Preconditions.requireRangeFrom(10, 9);
         >> IndexOutOfBoundsException
         
         
         If the index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9, 10);
         
         
        パラメータ:
        index - The index to be validated
        from - The lower limit
        例外:
        IndexOutOfBoundsException - If the number of the index argument does not exist within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(int index,
                                            int from,
                                            String message)
        Ensures that the index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeFrom(int, int, RuntimeException) method.

         If the index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRangeFrom(10, 9, "any message");
         >> IndexOutOfBoundsException
         
         
         If the index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9, 10, "any message");
         
         
        パラメータ:
        index - The index to be validated
        from - The lower limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument index does not fall within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(int index,
                                            int from,
                                            RuntimeException exception)
        Ensures that the index argument is a number within the range specified by from

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeFrom(int, int) method.

         If the index passed as an argument is less than the number specified by from, any of the specified exceptions will be thrown.
         
         Preconditions.requireRangeFrom(10, 9, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9, 10, new AnyRuntimeException());
         
         
        パラメータ:
        index - The index to be validated
        from - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the number of the index specified as an argument does not fall within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(long index,
                                            long from)
        Ensures that the long index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeFrom(long, long, RuntimeException) method.

         If the long index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         
         Preconditions.requireRangeFrom(10L, 9L);
         >> IndexOutOfBoundsException
         
         
         If the long index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9L, 10L);
         
         
        パラメータ:
        index - The long index to be validated
        from - The lower limit
        例外:
        IndexOutOfBoundsException - If the long number of the index argument does not exist within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(long index,
                                            long from,
                                            String message)
        Ensures that the long index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeFrom(long, long, RuntimeException) method.

         If the long index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRangeFrom(10L, 9L, "any message");
         >> IndexOutOfBoundsException
         
         
         If the long index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9L, 10L, "any message");
         
         
        パラメータ:
        index - The long index to be validated
        from - The lower limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument long index does not fall within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(long index,
                                            long from,
                                            RuntimeException exception)
        Ensures that the long index argument is a number within the range specified by from

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeFrom(long, long) method.

         If the long index passed as an argument is less than the number specified by from, any of the specified exceptions will be thrown.
         
         Preconditions.requireRangeFrom(10L, 9L, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the long index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9L, 10L, new AnyRuntimeException());
         
         
        パラメータ:
        index - The long index to be validated
        from - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the long number of the index specified as an argument does not fall within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(short index,
                                            short from)
        Ensures that the short index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeFrom(short, short, RuntimeException) method.

         If the short index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         
         short index = 10;
         short from = 9;
         Preconditions.requireRangeFrom(index, from);
         >> IndexOutOfBoundsException
         
         
         If the short index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         short index = 9;
         short from = 10;
         Preconditions.requireRangeFrom(index, from);
         
         
        パラメータ:
        index - The short index to be validated
        from - The lower limit
        例外:
        IndexOutOfBoundsException - If the short number of the index argument does not exist within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(short index,
                                            short from,
                                            String message)
        Ensures that the short index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeFrom(short, short, RuntimeException) method.

         If the short index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         short index = 10;
         short from = 9;
         Preconditions.requireRangeFrom(index, from, "any message");
         >> IndexOutOfBoundsException
         
         
         If the short index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         short index = 9;
         short index = 10;
         Preconditions.requireRangeFrom(index, from, "any message");
         
         
        パラメータ:
        index - The short index to be validated
        from - The lower limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument short index does not fall within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(short index,
                                            short from,
                                            RuntimeException exception)
        Ensures that the short index argument is a number within the range specified by from

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeFrom(short, short) method.

         If the short index passed as an argument is less than the number specified by from, any of the specified exceptions will be thrown.
         
         short index = 10;
         short from = 9;
         Preconditions.requireRangeFrom(index, from, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the short index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         short index = 9;
         short from = 10;
         Preconditions.requireRangeFrom(index, number, new AnyRuntimeException());
         
         
        パラメータ:
        index - The short index to be validated
        from - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the short number of the index specified as an argument does not fall within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(byte index,
                                            byte from)
        Ensures that the byte index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeFrom(byte, byte, RuntimeException) method.

         If the byte index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         
         byte index = 10;
         byte from = 9;
         Preconditions.requireRangeFrom(index, from);
         >> IndexOutOfBoundsException
         
         
         If the byte index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         byte index = 9;
         byte from = 10;
         Preconditions.requireRangeFrom(index, from);
         
         
        パラメータ:
        index - The byte index to be validated
        from - The lower limit
        例外:
        IndexOutOfBoundsException - If the byte number of the index argument does not exist within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(byte index,
                                            byte from,
                                            String message)
        Ensures that the byte index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeFrom(byte, byte, RuntimeException) method.

         If the byte index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         byte index = 10;
         byte from = 9;
         Preconditions.requireRangeFrom(index, from, "any message");
         >> IndexOutOfBoundsException
         
         
         If the byte index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         byte index = 9;
         byte index = 10;
         Preconditions.requireRangeFrom(index, from, "any message");
         
         
        パラメータ:
        index - The byte index to be validated
        from - The lower limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument byte index does not fall within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(byte index,
                                            byte from,
                                            RuntimeException exception)
        Ensures that the byte index argument is a number within the range specified by from

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeFrom(byte, byte) method.

         If the byte index passed as an argument is less than the number specified by from, any of the specified exceptions will be thrown.
         
         byte index = 10;
         byte from = 9;
         Preconditions.requireRangeFrom(index, from, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the byte index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         byte index = 9;
         byte from = 10;
         Preconditions.requireRangeFrom(index, number, new AnyRuntimeException());
         
         
        パラメータ:
        index - The byte index to be validated
        from - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the byte number of the index specified as an argument does not fall within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(float index,
                                            float from)
        Ensures that the float index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeFrom(float, float, RuntimeException) method.

         If the float index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         
         Preconditions.requireRangeFrom(10.0f, 9.0f);
         >> IndexOutOfBoundsException
         
         
         If the float index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9.0f, 10.0f);
         
         
        パラメータ:
        index - The float index to be validated
        from - The lower limit
        例外:
        IndexOutOfBoundsException - If the float number of the index argument does not exist within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(float index,
                                            float from,
                                            String message)
        Ensures that the float index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeFrom(float, float, RuntimeException) method.

         If the float index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRangeFrom(10.0f, 9.0f, "any message");
         >> IndexOutOfBoundsException
         
         
         If the float index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9.0f, 10.0f, "any message");
         
         
        パラメータ:
        index - The float index to be validated
        from - The lower limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument float index does not fall within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(float index,
                                            float from,
                                            RuntimeException exception)
        Ensures that the float index argument is a number within the range specified by from

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeFrom(float, float) method.

         If the float index passed as an argument is less than the number specified by from, any of the specified exceptions will be thrown.
         
         Preconditions.requireRangeFrom(10.0f, 9.0f, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the float index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9.0f, 10.0f, new AnyRuntimeException());
         
         
        パラメータ:
        index - The float index to be validated
        from - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the float number of the index specified as an argument does not fall within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(double index,
                                            double from)
        Ensures that the double index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeFrom(double, double, RuntimeException) method.

         If the double index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         
         Preconditions.requireRangeFrom(10.0d, 9.0d);
         >> IndexOutOfBoundsException
         
         
         If the double index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9.0d, 10.0d);
         
         
        パラメータ:
        index - The double index to be validated
        from - The lower limit
        例外:
        IndexOutOfBoundsException - If the double number of the index argument does not exist within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(double index,
                                            double from,
                                            String message)
        Ensures that the double index argument is a number within the range specified by from

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeFrom(double, double, RuntimeException) method.

         If the double index passed as an argument is less than the number specified by from, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRangeFrom(10.0d, 9.0d, "any message");
         >> IndexOutOfBoundsException
         
         
         If the double index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9.0d, 10.0d, "any message");
         
         
        パラメータ:
        index - The double index to be validated
        from - The lower limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument double index does not fall within the range specified by from
      • requireRangeFrom

        public static void requireRangeFrom​(double index,
                                            double from,
                                            RuntimeException exception)
        Ensures that the double index argument is a number within the range specified by from

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeFrom(double, double) method.

         If the double index passed as an argument is less than the number specified by from, any of the specified exceptions will be thrown.
         
         Preconditions.requireRangeFrom(10.0d, 9.0d, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the double index passed as an argument is greater than or equal to the value specified by "from", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeFrom(9.0d, 10.0d, new AnyRuntimeException());
         
         
        パラメータ:
        index - The double index to be validated
        from - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the double number of the index specified as an argument does not fall within the range specified by from
      • requireRangeTo

        public static void requireRangeTo​(int index,
                                          int to)
        Ensures that the index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeTo(int, int, RuntimeException) method.

         If the index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         
         Preconditions.requireRangeTo(10, 9);
         >> IndexOutOfBoundsException
         
         
         If the index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9, 10);
         
         
        パラメータ:
        index - The index to be validated
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the number of the index argument does not exist within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(int index,
                                          int to,
                                          String message)
        Ensures that the index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeTo(int, int, RuntimeException) method.

         If the index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRangeTo(10, 9, "any message");
         >> IndexOutOfBoundsException
         
         
         If the index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9, 10, "any message");
         
         
        パラメータ:
        index - The index to be validated
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument index does not fall within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(int index,
                                          int to,
                                          RuntimeException exception)
        Ensures that the index argument is a number within the range specified by to

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeTo(int, int) method.

         If the index passed as an argument is greater than the number specified by to, any of the specified exceptions will be thrown.
         
         Preconditions.requireRangeTo(10, 9, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9, 10, new AnyRuntimeException());
         
         
        パラメータ:
        index - The index to be validated
        to - The upper limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the number of the index specified as an argument does not fall within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(long index,
                                          long to)
        Ensures that the long index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeTo(long, long, RuntimeException) method.

         If the long index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         
         Preconditions.requireRangeTo(10L, 9L);
         >> IndexOutOfBoundsException
         
         
         If the long index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9L, 10L);
         
         
        パラメータ:
        index - The long index to be validated
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the long number of the index argument does not exist within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(long index,
                                          long to,
                                          String message)
        Ensures that the long index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeTo(long, long, RuntimeException) method.

         If the long index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRangeTo(10L, 9L, "any message");
         >> IndexOutOfBoundsException
         
         
         If the long index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9L, 10L, "any message");
         
         
        パラメータ:
        index - The long index to be validated
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument long index does not fall within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(long index,
                                          long to,
                                          RuntimeException exception)
        Ensures that the long index argument is a number within the range specified by to

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeTo(long, long) method.

         If the long index passed as an argument is greater than the number specified by to, any of the specified exceptions will be thrown.
         
         Preconditions.requireRangeTo(10L, 9L, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the long index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9L, 10L, new AnyRuntimeException());
         
         
        パラメータ:
        index - The long index to be validated
        to - The upper limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the long number of the index specified as an argument does not fall within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(short index,
                                          short to)
        Ensures that the short index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeTo(short, short, RuntimeException) method.

         If the short index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         
         short index = 10;
         short to = 9;
         Preconditions.requireRangeTo(index, to);
         >> IndexOutOfBoundsException
         
         
         If the short index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         short index = 9;
         short to = 10;
         Preconditions.requireRangeTo(index, to);
         
         
        パラメータ:
        index - The short index to be validated
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the short number of the index argument does not exist within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(short index,
                                          short to,
                                          String message)
        Ensures that the short index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeTo(short, short, RuntimeException) method.

         If the short index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         short index = 10;
         short to = 9;
         Preconditions.requireRangeTo(index, to, "any message");
         >> IndexOutOfBoundsException
         
         
         If the short index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         short index = 9;
         short to = 10;
         Preconditions.requireRangeTo(index, to, "any message");
         
         
        パラメータ:
        index - The short index to be validated
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument short index does not fall within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(short index,
                                          short to,
                                          RuntimeException exception)
        Ensures that the short index argument is a number within the range specified by to

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeTo(short, short) method.

         If the short index passed as an argument is greater than the number specified by to, any of the specified exceptions will be thrown.
         
         short index = 10;
         short to = 9;
         Preconditions.requireRangeTo(index, to, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the short index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         short index = 9;
         short to = 10;
         Preconditions.requireRangeTo(index, to, new AnyRuntimeException());
         
         
        パラメータ:
        index - The short index to be validated
        to - The upper limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the short number of the index specified as an argument does not fall within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(byte index,
                                          byte to)
        Ensures that the byte index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeTo(byte, byte, RuntimeException) method.

         If the byte index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         
         byte index = 10;
         byte to = 9;
         Preconditions.requireRangeTo(index, to);
         >> IndexOutOfBoundsException
         
         
         If the byte index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         byte index = 9;
         byte to = 10;
         Preconditions.requireRangeTo(index, to);
         
         
        パラメータ:
        index - The byte index to be validated
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the byte number of the index argument does not exist within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(byte index,
                                          byte to,
                                          String message)
        Ensures that the byte index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeTo(byte, byte, RuntimeException) method.

         If the byte index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         byte index = 10;
         byte to = 9;
         Preconditions.requireRangeTo(index, to, "any message");
         >> IndexOutOfBoundsException
         
         
         If the byte index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         byte index = 9;
         byte to = 10;
         Preconditions.requireRangeTo(index, to, "any message");
         
         
        パラメータ:
        index - The byte index to be validated
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument byte index does not fall within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(byte index,
                                          byte to,
                                          RuntimeException exception)
        Ensures that the byte index argument is a number within the range specified by to

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeTo(byte, byte) method.

         If the byte index passed as an argument is greater than the number specified by to, any of the specified exceptions will be thrown.
         
         byte index = 10;
         byte to = 9;
         Preconditions.requireRangeTo(index, to, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the byte index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         byte index = 9;
         byte to = 10;
         Preconditions.requireRangeTo(index, to, new AnyRuntimeException());
         
         
        パラメータ:
        index - The byte index to be validated
        to - The upper limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the byte number of the index specified as an argument does not fall within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(float index,
                                          float to)
        Ensures that the float index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeTo(float, float, RuntimeException) method.

         If the float index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         
         Preconditions.requireRangeTo(10.0f, 9.0f);
         >> IndexOutOfBoundsException
         
         
         If the float index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9.0f, 10.0f);
         
         
        パラメータ:
        index - The float index to be validated
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the float number of the index argument does not exist within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(float index,
                                          float to,
                                          String message)
        Ensures that the float index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeTo(float, float, RuntimeException) method.

         If the float index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRangeTo(10.0f, 9.0f, "any message");
         >> IndexOutOfBoundsException
         
         
         If the float index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9.0f, 10.0f, "any message");
         
         
        パラメータ:
        index - The float index to be validated
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument float index does not fall within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(float index,
                                          float to,
                                          RuntimeException exception)
        Ensures that the float index argument is a number within the range specified by to

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeTo(float, float) method.

         If the float index passed as an argument is greater than the number specified by to, any of the specified exceptions will be thrown.
         
         Preconditions.requireRangeTo(10.0f, 9.0f, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the float index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9.0f, 10.0f, new AnyRuntimeException());
         
         
        パラメータ:
        index - The float index to be validated
        to - The upper limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the float number of the index specified as an argument does not fall within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(double index,
                                          double to)
        Ensures that the double index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime.

        To specify an arbitrary exception object, use the requireRangeTo(double, double, RuntimeException) method.

         If the double index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         
         Preconditions.requireRangeTo(10.0d, 9.0d);
         >> IndexOutOfBoundsException
         
         
         If the double index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9.0d, 10.0d);
         
         
        パラメータ:
        index - The double index to be validated
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the double number of the index argument does not exist within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(double index,
                                          double to,
                                          String message)
        Ensures that the double index argument is a number within the range specified by to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. And the message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRangeTo(double, double, RuntimeException) method.

         If the double index passed as an argument is greater than the number specified by to, IndexOutOfBoundsException will be thrown.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRangeTo(10.0d, 9.0d, "any message");
         >> IndexOutOfBoundsException
         
         
         If the double index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9.0d, 10.0d, "any message");
         
         
        パラメータ:
        index - The double index to be validated
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the argument double index does not fall within the range specified by to
      • requireRangeTo

        public static void requireRangeTo​(double index,
                                          double to,
                                          RuntimeException exception)
        Ensures that the double index argument is a number within the range specified by to

        If index specified as an argument is not within the range specified by to , throw any exception object specified as an argument.

        If you do not specify an arbitrary exception object, use the requireRangeTo(double, double) method.

         If the double index passed as an argument is greater than the number specified by to, any of the specified exceptions will be thrown.
         
         Preconditions.requireRangeTo(10.0d, 9.0d, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the double index passed as an argument is less than or equal to the value specified by "to", this function does nothing and exits the validation process.
         
         Preconditions.requireRangeTo(9.0d, 10.0d, new AnyRuntimeException());
         
         
        パラメータ:
        index - The double index to be validated
        to - The upper limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the double number of the index specified as an argument does not fall within the range specified by to
      • requireRange

        public static void requireRange​(int index,
                                        int from,
                                        int to)
        Ensures that the index argument is within the range specified by from to to

        If the index argument is an out-of-range number, IndexOutOfBoundsException is always raised at runtime.

        To specify an arbitrary exception object, use the requireRange(int, int, int, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the index passed as an argument is not within the range specified by from and to.
         
         Preconditions.requireRange(10, 0, 9);
         >> IndexOutOfBoundsException
         
         
         If the index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9, 0, 10);
         
         
        パラメータ:
        index - The index to be validated
        from - The lower limit
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(int index,
                                        int from,
                                        int to,
                                        String message)
        Ensures that the index argument is within the range specified by from to to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRange(int, int, int, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the index passed as an argument is not within the range specified by from and to.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRange(10, 0, 9, "any message");
         >> IndexOutOfBoundsException
         
         
         If the index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9, 0, 10, "any message");
         
         
        パラメータ:
        index - The index to be validated
        from - The lower limit
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(int index,
                                        int from,
                                        int to,
                                        RuntimeException exception)
        Ensures that the index argument is within the range specified by from to to

        Throws an arbitrary exception object if the argument index is an out-of-range number. Execute from the requireRange(int, int, int) method, and throw IndexOutOfBoundsException as an exception object if the index argument is not a number within the range specified by from to to .

        If you do not specify an arbitrary exception object, use the requireRange(int, int, int) method.

         If the index passed as an argument is not within the range specified by from and to, any exception object passed as an argument will be thrown.
         
         Preconditions.requireRange(10, 0, 9, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9, 0, 10, new AnyRuntimeException());
         
         
        パラメータ:
        index - The index to be validated
        from - The upper limit
        to - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(long index,
                                        long from,
                                        long to)
        Ensures that the long index argument is within the range specified by from to to

        If the index argument is an out-of-range number, IndexOutOfBoundsException is always raised at runtime.

        To specify an arbitrary exception object, use the requireRange(long, long, long, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the long index passed as an argument is not within the range specified by from and to.
         
         Preconditions.requireRange(10L, 0L, 9L);
         >> IndexOutOfBoundsException
         
         
         If the long index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9L, 0L, 10L);
         
         
        パラメータ:
        index - The long index to be validated
        from - The lower limit
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the long number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(long index,
                                        long from,
                                        long to,
                                        String message)
        Ensures that the long index argument is within the range specified by from to to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRange(long, long, long, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the long index passed as an argument is not within the range specified by from and to.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRange(10L, 0L, 9L, "any message");
         >> IndexOutOfBoundsException
         
         
         If the long index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9L, 0L, 10L, "any message");
         
         
        パラメータ:
        index - The long index to be validated
        from - The lower limit
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the long number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(long index,
                                        long from,
                                        long to,
                                        RuntimeException exception)
        Ensures that the long index argument is within the range specified by from to to

        Throws an arbitrary exception object if the argument index is an out-of-range number. Execute from the requireRange(long, long, long) method, and throw IndexOutOfBoundsException as an exception object if the index argument is not a number within the range specified by from to to .

        If you do not specify an arbitrary exception object, use the requireRange(long, long, long) method.

         If the long index passed as an argument is not within the range specified by from and to, any exception object passed as an argument will be thrown.
         
         Preconditions.requireRange(10L, 0L, 9L, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the long index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9L, 0L, 10L, new AnyRuntimeException());
         
         
        パラメータ:
        index - The long index to be validated
        from - The upper limit
        to - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the long number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(short index,
                                        short from,
                                        short to)
        Ensures that the short index argument is within the range specified by from to to

        If the index argument is an out-of-range number, IndexOutOfBoundsException is always raised at runtime.

        To specify an arbitrary exception object, use the requireRange(short, short, short, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the short index passed as an argument is not within the range specified by from and to.
         
         short index = 10;
         short from = 0;
         short to = 9;
         Preconditions.requireRange(index, from, to);
         >> IndexOutOfBoundsException
         
         
         If the short index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         short index = 9;
         short from = 0;
         short to = 10;
         Preconditions.requireRange(index, from, to);
         
         
        パラメータ:
        index - The short index to be validated
        from - The lower limit
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the short number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(short index,
                                        short from,
                                        short to,
                                        String message)
        Ensures that the short index argument is within the range specified by from to to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRange(short, short, short, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the short index passed as an argument is not within the range specified by from and to.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         short index = 10;
         short from = 0;
         short to = 9;
         Preconditions.requireRange(index, from, to, "any message");
         >> IndexOutOfBoundsException
         
         
         If the short index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         short index = 9;
         short from = 0;
         short to = 10;
         Preconditions.requireRange(index, from, to, "any message");
         
         
        パラメータ:
        index - The short index to be validated
        from - The lower limit
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the short number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(short index,
                                        short from,
                                        short to,
                                        RuntimeException exception)
        Ensures that the short index argument is within the range specified by from to to

        Throws an arbitrary exception object if the argument index is an out-of-range number. Execute from the requireRange(short, short, short) method, and throw IndexOutOfBoundsException as an exception object if the index argument is not a number within the range specified by from to to .

        If you do not specify an arbitrary exception object, use the requireRange(short, short, short) method.

         If the short index passed as an argument is not within the range specified by from and to, any exception object passed as an argument will be thrown.
         
         short index = 10;
         short from = 0;
         short to = 9;
         Preconditions.requireRange(index, from, to, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the short index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         short index = 9;
         short from = 0;
         short to = 10;
         Preconditions.requireRange(index, from, to, new AnyRuntimeException());
         
         
        パラメータ:
        index - The short index to be validated
        from - The upper limit
        to - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the short number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(byte index,
                                        byte from,
                                        byte to)
        Ensures that the byte index argument is within the range specified by from to to

        If the index argument is an out-of-range number, IndexOutOfBoundsException is always raised at runtime.

        To specify an arbitrary exception object, use the requireRange(byte, byte, byte, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the byte index passed as an argument is not within the range specified by from and to.
         
         byte index = 10;
         byte from = 0;
         byte to = 9;
         Preconditions.requireRange(index, from, to);
         >> IndexOutOfBoundsException
         
         
         If the byte index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         byte index = 9;
         byte from = 0;
         byte to = 10;
         Preconditions.requireRange(index, from, to);
         
         
        パラメータ:
        index - The byte index to be validated
        from - The lower limit
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the byte number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(byte index,
                                        byte from,
                                        byte to,
                                        String message)
        Ensures that the byte index argument is within the range specified by from to to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRange(byte, byte, byte, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the byte index passed as an argument is not within the range specified by from and to.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         byte index = 10;
         byte from = 0;
         byte to = 9;
         Preconditions.requireRange(index, from, to, "any message");
         >> IndexOutOfBoundsException
         
         
         If the byte index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         byte index = 9;
         byte from = 0;
         byte to = 10;
         Preconditions.requireRange(index, from, to, "any message");
         
         
        パラメータ:
        index - The byte index to be validated
        from - The lower limit
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the byte number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(byte index,
                                        byte from,
                                        byte to,
                                        RuntimeException exception)
        Ensures that the byte index argument is within the range specified by from to to

        Throws an arbitrary exception object if the argument index is an out-of-range number. Execute from the requireRange(byte, byte, byte) method, and throw IndexOutOfBoundsException as an exception object if the index argument is not a number within the range specified by from to to .

        If you do not specify an arbitrary exception object, use the requireRange(byte, byte, byte) method.

         If the byte index passed as an argument is not within the range specified by from and to, any exception object passed as an argument will be thrown.
         
         byte index = 10;
         byte from = 0;
         byte to = 9;
         Preconditions.requireRange(index, from, to, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the byte index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         byte index = 9;
         byte from = 0;
         byte to = 10;
         Preconditions.requireRange(index, from, to, new AnyRuntimeException());
         
         
        パラメータ:
        index - The byte index to be validated
        from - The upper limit
        to - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the byte number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(float index,
                                        float from,
                                        float to)
        Ensures that the float index argument is within the range specified by from to to

        If the index argument is an out-of-range number, IndexOutOfBoundsException is always raised at runtime.

        To specify an arbitrary exception object, use the requireRange(float, float, float, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the float index passed as an argument is not within the range specified by from and to.
         
         Preconditions.requireRange(10.0f, 0.0f, 9.0f);
         >> IndexOutOfBoundsException
         
         
         If the float index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9.0f, 0.0f, 10.0f);
         
         
        パラメータ:
        index - The float index to be validated
        from - The lower limit
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the float number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(float index,
                                        float from,
                                        float to,
                                        String message)
        Ensures that the float index argument is within the range specified by from to to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRange(float, float, float, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the float index passed as an argument is not within the range specified by from and to.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRange(10.0f, 0.0f, 9.0f, "any message");
         >> IndexOutOfBoundsException
         
         
         If the float index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9.0f, 0.0f, 10.0f, "any message");
         
         
        パラメータ:
        index - The float index to be validated
        from - The lower limit
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the float number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(float index,
                                        float from,
                                        float to,
                                        RuntimeException exception)
        Ensures that the float index argument is within the range specified by from to to

        Throws an arbitrary exception object if the argument index is an out-of-range number. Execute from the requireRange(float, float, float) method, and throw IndexOutOfBoundsException as an exception object if the index argument is not a number within the range specified by from to to .

        If you do not specify an arbitrary exception object, use the requireRange(float, float, float) method.

         If the float index passed as an argument is not within the range specified by from and to, any exception object passed as an argument will be thrown.
         
         Preconditions.requireRange(10.0f, 0.0f, 9.0f, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the float index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9.0f, 0.0f, 10.0f, new AnyRuntimeException());
         
         
        パラメータ:
        index - The float index to be validated
        from - The upper limit
        to - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the float number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(double index,
                                        double from,
                                        double to)
        Ensures that the double index argument is within the range specified by from to to .  

        If the index argument is an out-of-range number, IndexOutOfBoundsException is always raised at runtime.

        To specify an arbitrary exception object, use the requireRange(double, double, double, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the double index passed as an argument is not within the range specified by from and to.
         
         Preconditions.requireRange(10.0d, 0.0d, 9.0d);
         >> IndexOutOfBoundsException
         
         
         If the double index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9.0d, 0.0d, 10.0d);
         
         
        パラメータ:
        index - The double index to be validated
        from - The lower limit
        to - The upper limit
        例外:
        IndexOutOfBoundsException - If the double number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(double index,
                                        double from,
                                        double to,
                                        String message)
        Ensures that the double index argument is within the range specified by from to to

        If the index argument is an out-of-range number, IndexOutOfBoundsException will always be raised at runtime. The message passed as an argument is output as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireRange(double, double, double, RuntimeException) method.

         IndexOutOfBoundsException will be thrown if the double index passed as an argument is not within the range specified by from and to.
         A message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireRange(10.0d, 0.0d, 9.0d, "any message");
         >> IndexOutOfBoundsException
         
         
         If the double index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9.0d, 0.0d, 10.0d, "any message");
         
         
        パラメータ:
        index - The double index to be validated
        from - The lower limit
        to - The upper limit
        message - Detailed messages to be output on exception throwing
        例外:
        IndexOutOfBoundsException - If the double number of the index argument does not fall within the range specified by from to to
      • requireRange

        public static void requireRange​(double index,
                                        double from,
                                        double to,
                                        RuntimeException exception)
        Ensures that the double index argument is within the range specified by from to to

        Throws an arbitrary exception object if the argument index is an out-of-range number. Execute from the requireRange(double, double, double) method, and throw IndexOutOfBoundsException as an exception object if the index argument is not a number within the range specified by from to to .

        If you do not specify an arbitrary exception object, use the requireRange(double, double, double) method.

         If the double index passed as an argument is not within the range specified by from and to, any exception object passed as an argument will be thrown.
         
         Preconditions.requireRange(10.0d, 0.0d, 9.0d, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the double index passed as an argument is within the range of from and to, it does nothing and ends the validation process.
         
         Preconditions.requireRange(9.0d, 0.0d, 10.0d, new AnyRuntimeException());
         
         
        パラメータ:
        index - The double index to be validated
        from - The upper limit
        to - The lower limit
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the exception object passed as an argument is null
        IndexOutOfBoundsException - If the double number of the index argument does not fall within the range specified by from to to
      • requireNonEmpty

        public static void requireNonEmpty​(List<?> list)
        Ensures that list passed as an argument is not null or an empty list. 

        To specify an arbitrary exception object, use the requireNonEmpty(List, RuntimeException) method.

         NullPointerException will be thrown if the list passed as an argument is null.
         
         Preconditions.requireNonEmpty(null);
         >> NullPointerException
         
         
         PreconditionFailedException will be thrown if the list passed as an argument is an empty list.
         
         Preconditions.requireNonEmpty(List.of());
         >> PreconditionFailedException
         
         
         If the list passed as an argument is not null and is not an empty list, the validation process is terminated without doing anything.
         
         Preconditions.requireNonEmpty(List.of("test"));
         
         
        パラメータ:
        list - The list to be validated
        例外:
        NullPointerException - If list is passed as an argument and null is passed
        PreconditionFailedException - If list passed as an argument is an empty list
      • requireNonEmpty

        public static void requireNonEmpty​(List<?> list,
                                           String message)
        Ensures that list passed as an argument is not null or an empty list. 

        To specify an arbitrary exception object, use requireNonEmpty(List, RuntimeException) method. The message passed as an argument will be printed as a detailed message when an exception is thrown.

         If the list argument is null, NullPointerException will be thrown.
         A message passed as an argument will be output as a detailed message when an exception occurs.
         
         Preconditions.requireNonEmpty(null, "any message");
         >> NullPointerException
         
         
         PreconditionFailedException is thrown if the list argument is an empty list.
         The message argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireNonEmpty(List.of(), "any message");
         >> PreconditionFailedException
         
         
         If the list passed as an argument is not null and is not an empty list, the validation process is terminated without doing anything.
         
         Preconditions.requireNonEmpty(List.of("test"), "any message");
         
         
        パラメータ:
        list - The list to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        NullPointerException - If list is passed as an argument and null is passed
        PreconditionFailedException - If list passed as an argument is an empty list
      • requireNonEmpty

        public static void requireNonEmpty​(List<?> list,
                                           RuntimeException exception)
        Ensures that list given as an argument is not null or an empty list. 

        If list is an empty list, throw any exception object passed as an argument. If it is executed by the requireNonEmpty(List) method and list is an empty list, it throws PreconditionFailedException as an exception object.

         NullPointerException will be thrown if the list passed as an argument is null.
         
         Preconditions.requireNonEmpty(null, new AnyRuntimeException());
         >> NullPointerException
         
         
         If the list passed as an argument is an empty list, any exception object passed as an argument is thrown.
         
         Preconditions.requireNonEmpty(List.of(), new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the list passed as an argument is not null and is not an empty list, the validation process is terminated without doing anything.
         
         Preconditions.requireNonEmpty(List.of("test"), new AnyRuntimeException());
         
         
        パラメータ:
        list - The list to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If list passed as an argument is null or if the exception object passed as an argument is null
        PreconditionFailedException - If it is executed by the requireNonEmpty(List) method and the list passed as an argument is an empty list
      • requireNonEmpty

        public static void requireNonEmpty​(Map<?,​?> map)
        Ensures that map passed as an argument is not null or an empty map. 

        To specify an arbitrary exception object, use the requireNonEmpty(Map, RuntimeException) method.

         If the map argument is null, NullPointerException will be thrown.
         
         Preconditions.requireNonEmpty(null);
         >> NullPointerException
         
         
         PreconditionFailedException will be thrown if the map passed as an argument is an empty map.
         
         Preconditions.requireNonEmpty(Map.of());
         >> PreconditionFailedException
         
         
         If the map passed as an argument is not null and is not an empty map, the validation process is ended without doing anything.
         
         Preconditions.requireNonEmpty(Map.of("test", "test"));
         
         
        パラメータ:
        map - The map to be validated
        例外:
        PreconditionFailedException - If the map passed as an argument does not contain any elements
      • requireNonEmpty

        public static void requireNonEmpty​(Map<?,​?> map,
                                           String message)
        Ensures that map passed as an argument is not null or an empty map. 

        To specify an arbitrary exception object, use the requireNonEmpty(Map, RuntimeException) method. The message passed as an argument will be printed as a detailed message when an exception is thrown.

         If the map argument is null, NullPointerException will be thrown.
         A message passed as an argument will be printed as a detailed message if an exception is raised.
         
         Preconditions.requireNonEmpty(null, "any message");
         >> NullPointerException
         
         
         If the map argument is an empty map, PreconditionFailedException will be thrown.
         The message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireNonEmpty(Map.of(), "any message");
         >> PreconditionFailedException
         
         
         If the map passed as an argument is not null and is not an empty map, the validation process is ended without doing anything.
         
         Preconditions.requireNonEmpty(Map.of("test", "test"), "any message");
         
         
        パラメータ:
        map - The map to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the map passed as an argument does not contain any elements
      • requireNonEmpty

        public static void requireNonEmpty​(Map<?,​?> map,
                                           RuntimeException exception)
        Ensures that map passed as an argument is not null or an empty map. 

        If map is an empty map, any exception object passed as an argument will be returned. Executed by the requireNonEmpty(Map) method, if the map passed as argument is an empty map, throws PreconditionFailedException as an exception object.

        If you do not specify an arbitrary exception object, use the requireNonEmpty(Map) method.

         If the map argument is null, NullPointerException will be thrown.
         
         Preconditions.requireNonEmpty(null, new AnyRuntimeException());
         >> NullPointerException
         
         
         If the map argument is an empty map, any exception object passed as an argument will be thrown.
         
         Preconditions.requireNonEmpty(Map.of(), new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the map passed as an argument is not null and is not an empty map, the validation process is ended without doing anything.
         
         Preconditions.requireNonEmpty(Map.of("test", "test"), new AnyRuntimeException());
         
         
        パラメータ:
        map - The map to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If map passed as an argument is null , or if any exception object passed as an argument is null
        PreconditionFailedException - If the map argument is an empty map
      • requireNonEmpty

        public static void requireNonEmpty​(Set<?> set)
        Ensures that set passed as an argument is not null or an empty set. 

        To specify an arbitrary exception object, use the requireNonEmpty(Set, RuntimeException) method.

         If the set argument is null, NullPointerException will be thrown.
         
         Preconditions.requireNonEmpty(null);
         >> NullPointerException
         
         
         PreconditionFailedException will be thrown if the set passed as an argument is an empty set.
         
         Preconditions.requireNonEmpty(Set.of());
         >> PreconditionFailedException
         
         
         If the set passed as an argument is not null and is not an empty set, the validation process is ended without doing anything.
         
         Preconditions.requireNonEmpty(Set.of("test"));
         
         
        パラメータ:
        set - The set to be validated
        例外:
        PreconditionFailedException - If the set passed as an argument does not contain any elements
      • requireNonEmpty

        public static void requireNonEmpty​(Set<?> set,
                                           String message)
        Ensures that set passed as an argument is not null or an empty set. 

        To specify an arbitrary exception object, use the requireNonEmpty(Set, RuntimeException) method. The message passed as an argument will be printed as a detailed message when an exception is thrown.

         If the set argument is null, NullPointerException will be thrown.
         A message passed as an argument will be printed as a detailed message if an exception is raised.
         
         Preconditions.requireNonEmpty(null, "any message");
         >> NullPointerException
         
         
         If the set argument is an empty set, PreconditionFailedException will be thrown.
         The message passed as an argument is output as a detailed message when an exception occurs.
         
         Preconditions.requireNonEmpty(Set.of(), "any message");
         >> PreconditionFailedException
         
         
         If the set passed as an argument is not null and is not an empty set, the validation process is ended without doing anything.
         
         Preconditions.requireNonEmpty(Set.of("test"), "any message");
         
         
        パラメータ:
        set - The set to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the set passed as an argument does not contain any elements
      • requireNonEmpty

        public static void requireNonEmpty​(Set<?> set,
                                           RuntimeException exception)
        Ensures that set passed as an argument is not null or an empty set. 

        If set is an empty set, any exception object passed as an argument will be returned. Executed by the requireNonEmpty(Set) method, if the set passed as argument is an empty set, throws PreconditionFailedException as an exception object.

        If you do not specify an arbitrary exception object, use the requireNonEmpty(Set) method.

         If the set argument is null, NullPointerException will be thrown.
         
         Preconditions.requireNonEmpty(null, new AnyRuntimeException());
         >> NullPointerException
         
         
         If the set argument is an empty set, any exception object passed as an argument will be thrown.
         
         Preconditions.requireNonEmpty(Set.of(), new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the set passed as an argument is not null and is not an empty set, the validation process is ended without doing anything.
         
         Preconditions.requireNonEmpty(Set.of("test"), new AnyRuntimeException());
         
         
        パラメータ:
        set - The set to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If set passed as an argument is null , or if any exception object passed as an argument is null
        PreconditionFailedException - If the set argument is an empty set
      • requireNonEmpty

        public static void requireNonEmpty​(Object[] array)
        Ensures that the array passed as an argument is not null or an empty array. 

        Throws PreconditionFailedException if the argument is either null or an empty array.

        To specify an arbitrary exception object, use the requireNonEmpty(Object[], RuntimeException) method.

         NullPointerException will be thrown if the argument passed to array is null.
         
         Preconditions.requireNonEmpty(null);
         >> NullPointerException
         
         
         PreconditionFailedException will be thrown if the array argument is an empty array.
         
         Preconditions.requireNonEmpty(new String[] {});
         >> PreconditionFailedException
         
         
         If the array argument is non-null and is not an empty array, the function does nothing and exits the validation process.
         
         Preconditions.requireNonEmpty(new String[] { "" });
         
         
        パラメータ:
        array - The array to be validated
        例外:
        NullPointerException - If the array passed as an argument is null
        PreconditionFailedException - If the array passed as an argument is an empty array
      • requireNonEmpty

        public static void requireNonEmpty​(Object[] array,
                                           String message)
        Ensures that the array passed as an argument is not null or an empty array. 

        Throws PreconditionFailedException if the array argument is null or an empty array. The message passed as an argument will be printed as a detailed message when an exception occurs.

        To specify an arbitrary exception object, use the requireNonEmpty(Object[], RuntimeException) method.

         If the array argument is null, NullPointerException will be thrown.
         A message passed as an argument will be printed as a detailed message when an exception is raised.
         
         Preconditions.requireNonEmpty(null, "any message");
         >> NullPointerException
         
         
         PreconditionFailedException is thrown if the array argument is an empty array.
         The message argument is output as a detailed message when an exception is raised.
         
         Preconditions.requireNonEmpty(new String[] {}, "any message");
         >> PreconditionFailedException
         
         
         If the array argument is non-null and is not an empty array, the function does nothing and exits the validation process.
         
         Preconditions.requireNonEmpty(new String[] { "" }, "any message");
         
         
        パラメータ:
        array - The array to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        NullPointerException - If the array passed as an argument is null
        PreconditionFailedException - If the array passed as an argument is an empty array
      • requireNonEmpty

        public static void requireNonEmpty​(Object[] array,
                                           RuntimeException exception)
        Ensures that the array passed as a number is not null or an empty array. 

        If the array passed as an argument is an empty array, throw an arbitrary exception object passed as an argument. Execute a requireNonEmpty(Object[]) method and then throw PreconditionFailedException if the array passed in as argument is an empty array.

         A NullPointerException will be thrown if the argument passed to array is null.
         
         Preconditions.requireNonEmpty(null, new AnyRuntimeException());
         >> NullPointerException
         
         
         If the array argument is an empty array, then any exception object passed as an argument will be thrown.
         
         Preconditions.requireNonEmpty(new String[] {}, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the array argument is non-null and is not an empty array, the function does nothing and exits the validation process.
         
         Preconditions.requireNonEmpty(new String[] { "" }, new AnyRuntimeException());
         
         
        パラメータ:
        array - The array to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If the array passed as an argument is null or if the exception object passed as an argument is null
        PreconditionFailedException - If the method requireNonEmpty(Object[]) is executed and the array passed as an argument is an empty array
      • requireStartWith

        public static void requireStartWith​(String string,
                                            String prefix)
        Ensures that a given string begins with the prefix specified by prefix .

        If the argument does not begin with a prefix specified by prefix, PreconditionFailedException will be thrown as an exception object at runtime.

        To specify an arbitrary exception object, use the requireStartWith(String, String, RuntimeException) method.

         If the string specified as an argument does not begin with a prefix, PreconditionFailedException will be thrown.
         
         Preconditions.requireStartWith("test", "est");
         >> PreconditionFailedException
         
         
         If the string argument begins with a prefix, the function does nothing and ends the validation process.
         
         Preconditions.requireStartWith("test", "test");
         
         
        パラメータ:
        string - The string to be validated
        prefix - The prefix
        例外:
        PreconditionFailedException - If a string passed as an argument does not start with a prefix specified by prefix
      • requireStartWith

        public static void requireStartWith​(String string,
                                            String prefix,
                                            String message)
        Ensures that a given string begins with the prefix specified by prefix .

        If the argument doesn't start with a prefix specified by prefix, then PreconditionFailedException will be thrown at runtime as an exception object. The message passed as an argument will be printed as a detailed message when the exception occurs.

        To specify an arbitrary exception object, use the requireStartWith(String, String, RuntimeException) method.

         If the string argument does not begin with the prefix prefix, PreconditionFailedException will be thrown.
         A message passed as an argument will be printed as a detailed message when an exception occurs.
         
         Preconditions.requireStartWith("test", "est", "any message");
         >> PreconditionFailedException
         
         
         If the string argument begins with a prefix, the function does nothing and ends the validation process.
         
         Preconditions.requireStartWith("test", "test", "any message");
         
         
        パラメータ:
        string - The string to be validated
        prefix - The prefix
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If a string passed as an argument does not start with a prefix specified by prefix
      • requireStartWith

        public static void requireStartWith​(String string,
                                            String prefix,
                                            int offset)
        Ensures that the argument starts with the prefix specified by prefix at the specified search start point.

        If the argument does not begin with a prefix specified by prefix, PreconditionFailedException will be thrown as an exception object at runtime.

        To specify an arbitrary exception object, use the requireStartWith(String, String, int, RuntimeException) method.

         If the string specified as an argument does not begin at the search start position specified by offset and the prefix specified by prefix, PreconditionFailedException will be thrown.
         
         Preconditions.requireStartWith("test", "st", 1);
         >> PreconditionFailedException
         
         
         If the string specified as an argument begins with a prefix specified by prefix from the search start position specified by offset, the function does nothing and ends the validation process.
         
         Preconditions.requireStartWith("test", "est", 1);
         
         
        パラメータ:
        string - The string to be validated
        prefix - The prefix
        offset - The offset
        例外:
        PreconditionFailedException - If a string passed as an argument does not start with a prefix specified by prefix from the specified search start point
      • requireStartWith

        public static void requireStartWith​(String string,
                                            String prefix,
                                            int offset,
                                            String message)
        Ensures that the argument starts with the prefix specified by prefix at the specified search start point.

        If the argument doesn't start with a prefix specified by prefix, then PreconditionFailedException will be thrown at runtime as an exception object. The message passed as an argument will be printed as a detailed message when the exception occurs.

        To specify an arbitrary exception object, use the requireStartWith(String, String, int, RuntimeException) method.

         If the string argument does not begin at the search start position specified by offset and the prefix specified by prefix, an PreconditionFailedException will be thrown.
         A message passed as an argument will be printed as a detailed message when an exception occurs.
         
         Preconditions.requireStartWith("test", "st", 1, "any message");
         >> PreconditionFailedException
         
         
         If the string specified as an argument begins with a prefix specified by prefix from the search start position specified by offset, the function does nothing and ends the validation process.
         
         Preconditions.requireStartWith("test", "est", 1, "any message");
         
         
        パラメータ:
        string - The string to be validated
        prefix - The prefix
        offset - The offset
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If a string passed as an argument does not begin with the prefix specified by prefix at the specified search start position
      • requireStartWith

        public static void requireStartWith​(String string,
                                            String prefix,
                                            RuntimeException exception)
        Ensures that a given string begins with the prefix specified by prefix .

        If a string specified as an argument does not begin with a prefix specified by prefix , any exception object specified as an argument will be thrown at runtime.

        If you do not specify an arbitrary exception object, use the requireStartWith(String, String) method.

         If the string argument does not begin with the prefix prefix, then any exception object specified as an argument is thrown.
         
         Preconditions.requireStartWith("test", "est", new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the string argument begins with a prefix, the function does nothing and ends the validation process.
         
         Preconditions.requireStartWith("test", "test", new AnyRuntimeException());
         
         
        パラメータ:
        string - The string to be validated
        prefix - The prefix
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If any exception object specified as an argument is null
      • requireStartWith

        public static void requireStartWith​(String string,
                                            String prefix,
                                            int offset,
                                            RuntimeException exception)
        Ensures that the argument starts with the prefix specified by prefix at the specified search start point.

        If the string specified as an argument does not begin with a prefix specified by prefix, any exception object passed as an argument is thrown.

        If you do not specify an arbitrary exception object, use the requireStartWith(String, String, int) method.

         If the string specified as an argument does not begin at the search start position specified by offset and prefixed by prefix, then any exception object specified as an argument is thrown.
         
         Preconditions.requireStartWith("test", "st", 1, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the string specified as an argument begins with a prefix specified by prefix from the search start position specified by offset, the function does nothing and ends the validation process.
         
         Preconditions.requireStartWith("test", "est", 1, new AnyRuntimeException());
         
         
        パラメータ:
        string - The string to be validated
        prefix - The prefix
        offset - The offset
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If any exception object passed as an argument is null
      • requireEndWith

        public static void requireEndWith​(String string,
                                          String suffix)
        Ensures that the string specified as an argument ends with the suffix specified by suffix .

        If the string specified as an argument does not end with the suffix specified by suffix , then PreconditionFailedException is thrown as an exception object at runtime.

        To specify an arbitrary exception object, use the requireEndWith(String, String, RuntimeException) method.

         If the string specified as an argument does not end with the suffix specified by suffix, PreconditionFailedException will be thrown.
         
         Preconditions.requireEndWith("test", "es");
         >> PreconditionFailedException
         
         
         If the string argument ends with a suffix, the function does nothing and ends the validation process.
         
         Preconditions.requireEndWith("test", "est");
         
         
        パラメータ:
        string - The string to be validated
        suffix - The suffix
        例外:
        PreconditionFailedException - If the string passed as an argument does not end with the suffix specified by suffix
      • requireEndWith

        public static void requireEndWith​(String string,
                                          String suffix,
                                          String message)
        Ensures that the string specified as an argument ends with the suffix specified by suffix .

        If the string passed as an argument does not end with the suffix specified by suffix, PreconditionFailedException will be thrown as an exception object at runtime. Any message passed as an argument will be printed as a detail message when the exception occurs.

        To specify an arbitrary exception object, use the requireEndWith(String, String, RuntimeException) method.

         If the string argument does not end with the suffix specified by suffix, PreconditionFailedException will be thrown.
         A message passed as an argument will be printed as a detailed message if an exception is thrown.
         
         Preconditions.requireEndWith("test", "es", "any message");
         >> PreconditionFailedException
         
         
         If the string argument ends with a suffix, the function does nothing and ends the validation process.
         
         Preconditions.requireEndWith("test", "est", "any message");
         
         
        パラメータ:
        string - The string to be validated
        suffix - The suffix
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the string passed as an argument does not end with the suffix specified by suffix
      • requireEndWith

        public static void requireEndWith​(String string,
                                          String suffix,
                                          RuntimeException exception)
        Ensures that the string specified as an argument ends with the suffix specified by suffix .

        If the string specified as an argument does not end with the suffix specified by suffix , then any exception object specified as an argument will be thrown at runtime.

        If you want to specify an arbitrary exception object, use the requireEndWith(String, String) method.

         If the string specified as an argument does not end with the suffix specified by suffix, then any exception object specified as an argument is thrown.
         
         Preconditions.requireEndWith("test", "es", new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the string argument ends with a suffix, the function does nothing and ends the validation process.
         
         Preconditions.requireEndWith("test", "est", new AnyRuntimeException());
         
         
        パラメータ:
        string - The string to be validated
        suffix - The suffix
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If any exception object specified as an argument is null
      • requireTrue

        public static void requireTrue​(boolean bool)
        Ensures that the boolean value given as an argument is true .

        To specify an arbitrary exception object, use the requireTrue(boolean, RuntimeException) method.

         If the boolean is false, then PreconditionFailedException is thrown.
         
         Preconditions.requireTrue(false);
         >> PreconditionFailedException
         
         
         If the boolean is true, the function does nothing and ends the validation process.
         
         Preconditions.requireTrue(true);
         
         
        パラメータ:
        bool - The value to be validated
        例外:
        PreconditionFailedException - If the boolean value given as an argument is false
      • requireTrue

        public static void requireTrue​(boolean bool,
                                       String message)
        Ensures that the boolean value given as an argument is true .

        If the boolean passed as an argument is false , PreconditionFailedException will be thrown as an exception object at runtime. Any message passed as an argument will be printed as a detail message when the exception occurs.

        To specify an arbitrary exception object, use the requireTrue(boolean, RuntimeException) method.

         If the boolean is false, then PreconditionFailedException is thrown.
         
         Preconditions.requireTrue(false, "any message");
         >> PreconditionFailedException
         
         
         If the boolean is true, the function does nothing and ends the validation process.
         
         Preconditions.requireTrue(true, "any message");
         
         
        パラメータ:
        bool - The value to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the boolean value given as an argument is false
      • requireTrue

        public static void requireTrue​(boolean bool,
                                       RuntimeException exception)
        Ensures that the boolean value given as an argument is true .

        If the boolean specified as an argument is false , then any exception object specified as an argument will be thrown at runtime.

        Use requireTrue(boolean) method if you do not specify any exception objects.

         If the boolean is false, then any exception object specified as an argument thrown.
         
         Preconditions.requireTrue(false, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the boolean is true, the function does nothing and ends the validation process.
         
         Preconditions.requireTrue(true, new AnyRuntimeException());
         
         
        パラメータ:
        bool - The value to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If any exception object specified as an argument is null
      • requireFalse

        public static void requireFalse​(boolean bool)
        Ensures that the boolean value given as an argument is false .

        To specify an arbitrary exception object, use the requireFalse(boolean, RuntimeException) method.

         If the boolean is true, then PreconditionFailedException is thrown.
         
         Preconditions.requireFalse(true);
         >> PreconditionFailedException
         
         
         If the boolean is false, the function does nothing and ends the validation process.
         
         Preconditions.requireFalse(false);
         
         
        パラメータ:
        bool - The value to be validated
        例外:
        PreconditionFailedException - If the boolean value given as an argument is true
      • requireFalse

        public static void requireFalse​(boolean bool,
                                        String message)
        Ensures that the boolean value given as an argument is false .

        If the boolean passed as an argument is true , PreconditionFailedException will be thrown as an exception object at runtime. Any message passed as an argument will be printed as a detail message when the exception occurs.

        To specify an arbitrary exception object, use the requireFalse(boolean, RuntimeException) method.

         If the boolean is true, then PreconditionFailedException is thrown.
         
         Preconditions.requireFalse(true, "any message");
         >> PreconditionFailedException
         
         
         If the boolean is false, the function does nothing and ends the validation process.
         
         Preconditions.requireFalse(false, "any message");
         
         
        パラメータ:
        bool - The value to be validated
        message - Detailed messages to be output on exception throwing
        例外:
        PreconditionFailedException - If the boolean value given as an argument is true
      • requireFalse

        public static void requireFalse​(boolean bool,
                                        RuntimeException exception)
        Ensures that the boolean value given as an argument is false .

        If the boolean specified as an argument is true , then any exception object specified as an argument will be thrown at runtime.

        Use requireFalse(boolean) method if you do not specify any exception objects.

         If the boolean is true, then any exception object specified as an argument is thrown.
         
         Preconditions.requireFalse(true, new AnyRuntimeException());
         >> AnyRuntimeException
         
         
         If the boolean is false, the function does nothing and ends the validation process.
         
         Preconditions.requireFalse(false, new AnyRuntimeException());
         
         
        パラメータ:
        bool - The value to be validated
        exception - Any exception object that is thrown if the preconditions are not met
        例外:
        NullPointerException - If any exception object specified as an argument is null