Index
All Classes and Interfaces|All Packages|Serialized Form
A
B
- Basic Usage Example - Search tag in package io.github.mangila.ensure4j
- Section
C
- collections() - Static method in class io.github.mangila.ensure4j.Ensure
- containsElement(T, Object) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Checks if the specified collection contains the given element.
- containsElement(T, Object, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Checks if the specified collection contains the given element.
- containsElement(T, Object, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Checks if the specified collection contains the given element.
E
- endsWith(String, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string ends with the specified suffix.
- endsWith(String, String, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string ends with the specified suffix.
- endsWith(String, String, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string ends with the specified suffix.
- Ensure - Class in io.github.mangila.ensure4j
-
Acts as a utility hub for typed pre- and post-condition checks but keeps the most frequently used ones in the top level class.
- EnsureArrayOps - Enum Class in io.github.mangila.ensure4j.ops
-
Provides utility methods for validating and operating on primitive arrays.
- EnsureBooleanOps - Enum Class in io.github.mangila.ensure4j.ops
-
Provides utility methods for validating and operating on booleans.
- EnsureCollectionOps - Enum Class in io.github.mangila.ensure4j.ops
-
Provides utility methods for validating and operating on collections.
- EnsureException - Exception Class in io.github.mangila.ensure4j
-
Represents an exception that can be used for validation or ensuring specific conditions are met during runtime.
- EnsureException(String) - Constructor for exception class io.github.mangila.ensure4j.EnsureException
-
Constructs a new
EnsureExceptionwith the specified detail message. - EnsureMapOps - Enum Class in io.github.mangila.ensure4j.ops
-
Provides utility methods for validating and operating on maps.
- EnsureNullOps - Enum Class in io.github.mangila.ensure4j.ops
-
Provides utility methods for validating and operating on null.
- EnsureNumberOps - Enum Class in io.github.mangila.ensure4j.ops
-
Provides utility methods for validating and operating on numbers.
- EnsureObjectOps - Enum Class in io.github.mangila.ensure4j.ops
-
Provides utility methods for validating and operating on Objects.
- EnsureStringOps - Enum Class in io.github.mangila.ensure4j.ops
-
Provides utility methods for validating and operating on strings.
- EnsureUtils - Class in io.github.mangila.ensure4j.internal
-
Internal utility class for Ensure4j.
G
- getSupplierOrThrow(Supplier<T>) - Static method in class io.github.mangila.ensure4j.internal.EnsureUtils
-
Retrieves the value provided by the given
Supplier.
I
- INSTANCE - Enum constant in enum class io.github.mangila.ensure4j.ops.EnsureArrayOps
- INSTANCE - Enum constant in enum class io.github.mangila.ensure4j.ops.EnsureBooleanOps
- INSTANCE - Enum constant in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
- INSTANCE - Enum constant in enum class io.github.mangila.ensure4j.ops.EnsureMapOps
- INSTANCE - Enum constant in enum class io.github.mangila.ensure4j.ops.EnsureNullOps
- INSTANCE - Enum constant in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
- INSTANCE - Enum constant in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
- INSTANCE - Enum constant in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
- Internal Responsibilities - Search tag in package io.github.mangila.ensure4j.internal
- Section
- io.github.mangila.ensure4j - package io.github.mangila.ensure4j
-
Provides the core API for Ensure4j, a lightweight, zero-dependency Java library designed for robust precondition and postcondition validation.
- io.github.mangila.ensure4j.internal - package io.github.mangila.ensure4j.internal
-
Internal utility and support classes for the Ensure4j library.
- io.github.mangila.ensure4j.ops - package io.github.mangila.ensure4j.ops
-
Provides specialized operation classes for performing type-specific precondition and postcondition checks.
- isBlank(String) - Static method in class io.github.mangila.ensure4j.internal.EnsureUtils
-
Checks if the provided string is blank.
- isEquals(T, Object) - Method in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
-
Asserts that two objects are equal.
- isEquals(T, Object, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
-
Compares two objects for equality and throws an EnsureException with the specified message if they are not equal.
- isEquals(T, Object, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
-
Compares two objects for equality and throws a provided exception if they are not equal.
- isEquals(T, T) - Method in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
-
Compares two enum values for equality and throws an exception if they are not equal.
- isEquals(T, T, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
-
Compares two Enum values for equality and throws an EnsureException if they are not equal.
- isEquals(T, T, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
-
Compares two enum values for equality and throws an exception if they are not equal.
- isFalse(boolean) - Static method in class io.github.mangila.ensure4j.Ensure
- isFalse(boolean) - Method in enum class io.github.mangila.ensure4j.ops.EnsureBooleanOps
-
Ensures that the provided boolean value is false.
- isFalse(boolean, String) - Static method in class io.github.mangila.ensure4j.Ensure
- isFalse(boolean, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureBooleanOps
-
Ensures that the provided boolean value is false.
- isFalse(boolean, Supplier<RuntimeException>) - Static method in class io.github.mangila.ensure4j.Ensure
- isFalse(boolean, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureBooleanOps
-
Ensures that the provided boolean value is false.
- isInstanceOf(Class<T>, Object) - Method in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
-
Validates that the provided object is an instance of the specified class.
- isInstanceOf(Class<T>, Object, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
-
Ensures that the specified object is an instance of the given class.
- isInstanceOf(Class<T>, Object, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
-
Checks if the given object is an instance of the specified class.
- isNull(Object) - Static method in class io.github.mangila.ensure4j.internal.EnsureUtils
-
Checks whether the given object is null.
- isTrue(boolean) - Static method in class io.github.mangila.ensure4j.Ensure
- isTrue(boolean) - Method in enum class io.github.mangila.ensure4j.ops.EnsureBooleanOps
-
Ensures that the provided boolean value is true.
- isTrue(boolean, String) - Static method in class io.github.mangila.ensure4j.Ensure
- isTrue(boolean, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureBooleanOps
-
Ensures that the provided expression evaluates to
true. - isTrue(boolean, Supplier<RuntimeException>) - Static method in class io.github.mangila.ensure4j.Ensure
- isTrue(boolean, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureBooleanOps
-
Validates that the given boolean expression is true.
K
- Key Features - Search tag in package io.github.mangila.ensure4j
- Section
- Key Operation Classes - Search tag in package io.github.mangila.ensure4j.ops
- Section
M
- maps() - Static method in class io.github.mangila.ensure4j.Ensure
- max(int, int) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Compares two integers and ensures the second integer is less than or equal to the first integer.
- max(int, int, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Determines the maximum value between the specified integer values, and throws an
EnsureExceptionwith the provided message if the conditions are not met. - max(int, int, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Compares the provided number with a specified maximum value and throws a runtime exception if the number exceeds the maximum.
- max(long, long) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Returns the maximum of the boundary and value.
- max(long, long, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the given value does not exceed the specified boundary.
- max(long, long, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Returns the given value if it is less than or equal to the specified boundary.
- maxLength(int, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string has a maximum length.
- maxLength(int, String, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string has a maximum length.
- maxLength(int, String, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string has a maximum length.
- min(int, int) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Compares two integers and ensures that the given value is greater than or equal to the defined minimum.
- min(int, int, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Compares the given integers and ensures that the second integer is not less than the minimum value, throwing an exception with a specified message if the condition is violated.
- min(int, int, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Compares a value against a minimum threshold and throws a supplied exception if the value is less than the threshold.
- min(long, long) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Determines the minimum value constrained by a specified boundary.
- min(long, long, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that a given value meets or exceeds a specified boundary.
- min(long, long, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is greater than or equal to the specified boundary.
- minLength(int, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string has a minimum length.
- minLength(int, String, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string has a minimum length.
- minLength(int, String, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string has a minimum length.
N
- negative(int) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative.
- negative(int, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative.
- negative(int, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative.
- negative(long) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative.
- negative(long, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative.
- negative(long, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative.
- negativeWithZero(int) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative or zero.
- negativeWithZero(int, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative or zero.
- negativeWithZero(int, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative or zero.
- negativeWithZero(long) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative or zero.
- negativeWithZero(long, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative or zero.
- negativeWithZero(long, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is negative or zero.
- notBlank(String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string is not blank.
- notBlank(String, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string is not blank.
- notBlank(String, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string is not blank.
- notBlankOrElse(String, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Returns the given string if it is not blank; otherwise, returns the specified fallback value.
- notBlankOrElseGet(String, Supplier<String>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Returns the provided string if it is not blank (non-null and containing non-whitespace characters), otherwise retrieves and returns a value from the provided fallback supplier.
- notContainsNull(T) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Ensures that the provided collection does not contain any null elements.
- notContainsNull(T, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Ensures that the provided collection does not contain any null elements.
- notContainsNull(T, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Ensures that the provided collection does not contain any null elements.
- notContainsNullIterate(T) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Ensures that the provided collection does not contain any null elements.
- notContainsNullIterate(T, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Ensures that the provided collection does not contain any null elements.
- notContainsNullIterate(T, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Ensures that the provided collection does not contain any null elements.
- notEmpty(T) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Validates that the provided collection is not null and not empty.
- notEmpty(T) - Method in enum class io.github.mangila.ensure4j.ops.EnsureMapOps
-
Validates that the provided map is not empty.
- notEmpty(T[]) - Method in enum class io.github.mangila.ensure4j.ops.EnsureArrayOps
-
Ensures that the provided array is not empty.
- notEmpty(T[], String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureArrayOps
-
Checks if the provided array is not empty.
- notEmpty(T[], Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureArrayOps
-
Validates that the given array is not empty.
- notEmpty(T, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Validates that the provided collection is not null and not empty.
- notEmpty(T, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureMapOps
-
Ensures that the provided map is not empty.
- notEmpty(T, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Validates that the provided collection is not null and not empty.
- notEmpty(T, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureMapOps
-
Validates that the provided map is not empty.
- notNull(T) - Static method in class io.github.mangila.ensure4j.Ensure
- notNull(T) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNullOps
-
Ensures that the provided object is not null.
- notNull(T, String) - Static method in class io.github.mangila.ensure4j.Ensure
- notNull(T, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNullOps
-
Ensures that the provided object is not null.
- notNull(T, Supplier<RuntimeException>) - Static method in class io.github.mangila.ensure4j.Ensure
- notNull(T, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNullOps
-
Ensures that the provided object is not null.
- notNullOrElse(T, T) - Static method in class io.github.mangila.ensure4j.Ensure
- notNullOrElse(T, T) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNullOps
-
Returns the provided object if it is not null; otherwise, returns the given default object.
- notNullOrElseGet(T, Supplier<T>) - Static method in class io.github.mangila.ensure4j.Ensure
- notNullOrElseGet(T, Supplier<T>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNullOps
-
Returns the given object if it is not null; otherwise, it evaluates and returns the result from the supplied
Supplier. - notNullOrElseThrow(T) - Static method in class io.github.mangila.ensure4j.Ensure
-
Deprecated, for removal: This API element is subject to removal in a future version.
- notNullOrElseThrow(T) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNullOps
-
Deprecated, for removal: This API element is subject to removal in a future version.
- notNullOrElseThrow(T, Supplier<RuntimeException>) - Static method in class io.github.mangila.ensure4j.Ensure
-
Deprecated, for removal: This API element is subject to removal in a future version.
- notNullOrElseThrow(T, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNullOps
-
Deprecated, for removal: This API element is subject to removal in a future version.
- numbers() - Static method in class io.github.mangila.ensure4j.Ensure
O
- objects() - Static method in class io.github.mangila.ensure4j.Ensure
- of(String) - Static method in exception class io.github.mangila.ensure4j.EnsureException
-
Creates a new instance of
EnsureExceptionwith the specified message.
P
- positive(int) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive.
- positive(int, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive.
- positive(int, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive.
- positive(long) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive.
- positive(long, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive.
- positive(long, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive.
- positiveWithZero(int) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive or zero (non-negative).
- positiveWithZero(int, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive or zero (non-negative).
- positiveWithZero(int, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive or zero (non-negative).
- positiveWithZero(long) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive or zero (non-negative).
- positiveWithZero(long, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive or zero (non-negative).
- positiveWithZero(long, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Ensures that the provided value is positive or zero (non-negative).
S
- startsWith(String, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string starts with the specified prefix.
- startsWith(String, String, String) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string starts with the specified prefix.
- startsWith(String, String, Supplier<RuntimeException>) - Method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Ensures that the provided string starts with the specified prefix.
- strings() - Static method in class io.github.mangila.ensure4j.Ensure
U
- Usage - Search tag in package io.github.mangila.ensure4j.ops
- Section
V
- valueOf(String) - Static method in enum class io.github.mangila.ensure4j.ops.EnsureArrayOps
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.github.mangila.ensure4j.ops.EnsureBooleanOps
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.github.mangila.ensure4j.ops.EnsureMapOps
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.github.mangila.ensure4j.ops.EnsureNullOps
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class io.github.mangila.ensure4j.ops.EnsureArrayOps
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.github.mangila.ensure4j.ops.EnsureBooleanOps
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.github.mangila.ensure4j.ops.EnsureCollectionOps
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.github.mangila.ensure4j.ops.EnsureMapOps
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.github.mangila.ensure4j.ops.EnsureNullOps
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.github.mangila.ensure4j.ops.EnsureNumberOps
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.github.mangila.ensure4j.ops.EnsureObjectOps
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.github.mangila.ensure4j.ops.EnsureStringOps
-
Returns an array containing the constants of this enum class, in the order they are declared.
All Classes and Interfaces|All Packages|Serialized Form
EnsureNullOps.notNull(Object)()} instead.