|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjp.sf.orangesignal.ta.util.Assert
public abstract class Assert
表明(前提条件)検証用のユーティリティを提供します。
コンストラクタの概要 | |
---|---|
Assert()
|
メソッドの概要 | |
---|---|
static void |
isEmpty(Collection<?> collection)
指定されたコレクションに要素が存在しないことを表明します。 |
static void |
isEmpty(Collection<?> collection,
String message)
指定されたコレクションに要素が存在しないことを表明します。 |
static void |
isEmpty(Map<?,?> map)
指定されたマップにエントリが存在しないことを表明します。 |
static void |
isEmpty(Map<?,?> map,
String message)
指定されたマップにエントリが存在しないことを表明します。 |
static void |
isEmpty(Object[] array)
指定された配列に要素が存在しないことを表明します。 |
static void |
isEmpty(Object[] array,
String message)
指定された配列に要素が存在しないことを表明します。 |
static void |
isEmpty(String str)
指定された文字列が空であることを表明します。 |
static void |
isEmpty(String str,
String message)
指定された文字列が空であることを表明します。 |
static void |
isFalse(boolean expression)
指定された式を表明します。 |
static void |
isFalse(boolean expression,
String message)
指定された式を表明します。 |
static void |
isNull(Object object)
指定されたオブジェクトが null であることを表明します。 |
static void |
isNull(Object object,
String message)
指定されたオブジェクトが null であることを表明します。 |
static void |
isTrue(boolean expression)
指定された式を表明します。 |
static void |
isTrue(boolean expression,
String message)
指定された式を表明します。 |
static void |
noNullElements(Collection<?> collection)
指定されたコレクションに null の要素が存在しないことを表明します。 |
static void |
noNullElements(Collection<?> collection,
String message)
指定されたコレクションに null の要素が存在しないことを表明します。 |
static void |
noNullElements(Object[] array)
指定された配列に null の要素が存在しないことを表明します。 |
static void |
noNullElements(Object[] array,
String message)
指定された配列に null の要素が存在しないことを表明します。 |
static void |
notEmpty(Collection<?> collection)
指定されたコレクションに要素が存在することを表明します。 |
static void |
notEmpty(Collection<?> collection,
String message)
指定されたコレクションに要素が存在することを表明します。 |
static void |
notEmpty(Map<?,?> map)
指定されたマップにエントリが存在することを表明します。 |
static void |
notEmpty(Map<?,?> map,
String message)
指定されたマップにエントリが存在することを表明します。 |
static void |
notEmpty(Object[] array)
指定された配列に要素が存在することを表明します。 |
static void |
notEmpty(Object[] array,
String message)
指定された配列に要素が存在することを表明します。 |
static void |
notEmpty(String str)
指定された文字列が空でないことを表明します。 |
static void |
notEmpty(String str,
String message)
指定された文字列が空でないことを表明します。 |
static void |
notNull(Object object)
指定されたオブジェクトが null でないことを表明します。 |
static void |
notNull(Object object,
String message)
指定されたオブジェクトが null でないことを表明します。 |
static void |
state(boolean expression)
指定された式を表明します。 |
static void |
state(boolean expression,
String message)
指定された式を表明します。 |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
public Assert()
メソッドの詳細 |
---|
public static void isTrue(boolean expression, String message) throws IllegalArgumentException
false
の場合は、IllegalArgumentException
をスローします。
Assert.isTrue(i > 0, "The value must be greater than zero");
expression
- 式message
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- 式が false
の場合public static void isTrue(boolean expression) throws IllegalArgumentException
false
の場合は、IllegalArgumentException
をスローします。
Assert.isTrue(i > 0);
expression
- 式
IllegalArgumentException
- 式が false
の場合public static void isFalse(boolean expression, String message) throws IllegalArgumentException
true
の場合は、IllegalArgumentException
をスローします。
Assert.isFalse(i > 0, "The value must be greater than zero");
expression
- 式message
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- 式が true
の場合public static void isFalse(boolean expression) throws IllegalArgumentException
true
の場合は、IllegalArgumentException
をスローします。
Assert.isFalse(i > 0);
expression
- 式
IllegalArgumentException
- 式が true
の場合public static void isNull(Object object, String message) throws IllegalArgumentException
null
であることを表明します。
Assert.isNull(value, "The value must be null");
object
- 検査するオブジェクトmessage
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- オブジェクトが null
でない場合public static void isNull(Object object) throws IllegalArgumentException
null
であることを表明します。
Assert.isNull(value);
object
- 検査するオブジェクト
IllegalArgumentException
- オブジェクトが null
でない場合public static void notNull(Object object, String message) throws IllegalArgumentException
null
でないことを表明します。
Assert.notNull(clazz, "The class must not be null");
object
- 検査するオブジェクトmessage
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- オブジェクトが null
の場合public static void notNull(Object object) throws IllegalArgumentException
null
でないことを表明します。
Assert.notNull(clazz);
object
- 検査するオブジェクト
IllegalArgumentException
- オブジェクトが null
の場合public static void isEmpty(String str, String message) throws IllegalArgumentException
IllegalArgumentException
をスローします。
Assert.isEmpty(name, "Name must be empty");
str
- 検査する文字列message
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- 文字列が空でない場合public static void isEmpty(String str) throws IllegalArgumentException
IllegalArgumentException
をスローします。
Assert.isEmpty(name);
str
- 検査する文字列
IllegalArgumentException
- 文字列が空でない場合public static void isEmpty(Object[] array, String message) throws IllegalArgumentException
IllegalArgumentException
をスローします。
Assert.isEmpty(array, "The array must have no elements");
array
- 検査する配列message
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- 配列に要素が存在する場合public static void isEmpty(Object[] array) throws IllegalArgumentException
IllegalArgumentException
をスローします。
Assert.isEmpty(array);
array
- 検査する配列
IllegalArgumentException
- 配列に要素が存在する場合public static void isEmpty(Collection<?> collection, String message) throws IllegalArgumentException
IllegalArgumentException
をスローします。
Assert.isEmpty(collection, "Collection must have no elements");
collection
- 検査するコレクションmessage
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- コレクションに要素が存在する場合public static void isEmpty(Collection<?> collection) throws IllegalArgumentException
IllegalArgumentException
をスローします。
Assert.isEmpty(collection);
collection
- 検査するコレクション
IllegalArgumentException
- コレクションに要素が存在する場合public static void isEmpty(Map<?,?> map, String message) throws IllegalArgumentException
IllegalArgumentException
をスローします。
Assert.isEmpty(map, "Map must have no entries");
map
- 検査するマップmessage
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- マップにエントリが存在する場合public static void isEmpty(Map<?,?> map) throws IllegalArgumentException
IllegalArgumentException
をスローします。
Assert.isEmpty(map);
map
- 検査するマップ
IllegalArgumentException
- マップにエントリが存在する場合public static void notEmpty(String str, String message) throws IllegalArgumentException
null
または空の場合は、IllegalArgumentException
をスローします。
Assert.notEmpty(name, "Name must not be empty");
str
- 検査する文字列message
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- 文字列が null
または空の場合public static void notEmpty(String str) throws IllegalArgumentException
null
または空の場合は、IllegalArgumentException
をスローします。
Assert.notEmpty(name);
str
- 検査する文字列
IllegalArgumentException
- 文字列が null
または空の場合public static void notEmpty(Object[] array, String message) throws IllegalArgumentException
null
または配列に要素が存在しない場合は、IllegalArgumentException
をスローします。
Assert.notEmpty(array, "The array must have elements");
array
- 検査する配列message
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- 配列が null
または配列に要素が存在しない場合public static void notEmpty(Object[] array) throws IllegalArgumentException
null
または配列に要素が存在しない場合は、IllegalArgumentException
をスローします。
Assert.notEmpty(array);
array
- 検査する配列
IllegalArgumentException
- 配列が null
または配列に要素が存在しない場合public static void notEmpty(Collection<?> collection, String message) throws IllegalArgumentException
null
またはコレクションに要素が存在しない場合は、IllegalArgumentException
をスローします。
Assert.notEmpty(collection, "Collection must have elements");
collection
- 検査するコレクションmessage
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- コレクションが null
またはコレクションに要素が存在しない場合public static void notEmpty(Collection<?> collection) throws IllegalArgumentException
null
またはコレクションに要素が存在しない場合は、IllegalArgumentException
をスローします。
Assert.notEmpty(collection);
collection
- 検査するコレクション
IllegalArgumentException
- コレクションが null
またはコレクションに要素が存在しない場合public static void notEmpty(Map<?,?> map, String message) throws IllegalArgumentException
null
またはマップにエントリが存在しない場合は、IllegalArgumentException
をスローします。
Assert.notEmpty(map, "Map must have entries");
map
- 検査するマップmessage
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- マップが null
またはマップにエントリが存在しない場合public static void notEmpty(Map<?,?> map) throws IllegalArgumentException
null
またはマップにエントリが存在しない場合は、IllegalArgumentException
をスローします。
Assert.notEmpty(map);
map
- 検査するマップ
IllegalArgumentException
- マップが null
またはマップにエントリが存在しない場合public static void noNullElements(Object[] array, String message) throws IllegalArgumentException
null
の要素が存在しないことを表明します。
指定された配列に null
の要素が存在する場合は、IllegalArgumentException
をスローします。
Assert.noNullElements(array, "The array must not contain null elements");
array
- 検査する配列message
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- 配列に null
の要素が存在する場合public static void noNullElements(Object[] array) throws IllegalArgumentException
null
の要素が存在しないことを表明します。
指定された配列に null
の要素が存在する場合は、IllegalArgumentException
をスローします。
Assert.noNullElements(array);
array
- 検査する配列
IllegalArgumentException
- 配列に null
の要素が存在する場合public static void noNullElements(Collection<?> collection, String message) throws IllegalArgumentException
null
の要素が存在しないことを表明します。
指定されたコレクションに null
の要素が存在する場合は、IllegalArgumentException
をスローします。
Assert.noNullElements(collection, "The collection must not contain null elements");
collection
- 検査するコレクションmessage
- 例外をスローする場合に使用するメッセージ
IllegalArgumentException
- コレクションに null
の要素が存在する場合public static void noNullElements(Collection<?> collection) throws IllegalArgumentException
null
の要素が存在しないことを表明します。
指定されたコレクションに null
の要素が存在する場合は、IllegalArgumentException
をスローします。
Assert.noNullElements(collection);
collection
- 検査するコレクション
IllegalArgumentException
- コレクションに null
の要素が存在する場合public static void state(boolean expression, String message) throws IllegalStateException
false
の場合は、IllegalStateException
をスローします。
Assert.state(id == null, "The id property must not already be initialized");
expression
- 式message
- 例外をスローする場合に使用するメッセージ
IllegalStateException
- 式が false
の場合public static void state(boolean expression) throws IllegalStateException
false
の場合は、IllegalStateException
をスローします。
Assert.state(id == null);
expression
- 式
IllegalStateException
- 式が false
の場合
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |