Example usage for Java com.google.common.base Preconditions fields, constructors, methods, implement or subclass
The text is from its open source code.
void | checkArgument(boolean expression, @Nullable Object errorMessage) Ensures the truth of an expression involving one or more parameters to the calling method. |
void | checkArgument(boolean expression) Ensures the truth of an expression involving one or more parameters to the calling method. |
void | checkArgument(boolean expression, @Nullable String errorMessageTemplate, @Nullable Object... errorMessageArgs) Ensures the truth of an expression involving one or more parameters to the calling method. |
int | checkElementIndex(int index, int size, @Nullable String desc) Ensures that index specifies a valid element in an array, list or string of size size . |
int | checkElementIndex(int index, int size) Ensures that index specifies a valid element in an array, list or string of size size . |
T | checkNotNull(T reference) Ensures that an object reference passed as a parameter to the calling method is not null. |
T | checkNotNull(T reference, @Nullable Object errorMessage) Ensures that an object reference passed as a parameter to the calling method is not null. |
T | checkNotNull(T reference, @Nullable String errorMessageTemplate, @Nullable Object... errorMessageArgs) Ensures that an object reference passed as a parameter to the calling method is not null. |
int | checkPositionIndex(int index, int size) Ensures that index specifies a valid position in an array, list or string of size size . |
int | checkPositionIndex(int index, int size, @Nullable String desc) Ensures that index specifies a valid position in an array, list or string of size size . |
void | checkPositionIndexes(int start, int end, int size) Ensures that start and end specify a valid positions in an array, list or string of size size , and are in order. |
void | checkState(boolean expression) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method. |
void | checkState(boolean expression, @Nullable Object errorMessage) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method. |
void | checkState(boolean expression, @Nullable String errorMessageTemplate, @Nullable Object... errorMessageArgs) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method. |