Class ChecksBase<T,C extends ChecksBase<T,C>>
java.lang.Object
dev.prozilla.pine.common.util.checks.ChecksBase<T,C>
- Direct Known Subclasses:
ArrayChecks,CollectionChecks,ObjectChecks,StringChecks
Utility class for chaining checks using functional programming on a named value
and throwing a descriptive error if one of the checks is not met.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal CasString(Consumer<StringChecks> stringChecks) Performs checks on the value as a string.final Tget()protected abstract Stringfinal CChecks that the value is equal to a given object.final CisNotEqualTo(Object other) Checks that the value is not equal to a given object.final CChecks that the value is not null.final Cprotected abstract Cself()
-
Field Details
-
value
-
name
-
-
Constructor Details
-
ChecksBase
-
-
Method Details
-
named
-
get
-
asString
Performs checks on the value as a string.- Parameters:
stringChecks- The checks to perform
-
isEqualTo
Checks that the value is equal to a given object.- Parameters:
other- The object- Throws:
InvalidObjectException- If the value is not equal to the object
-
isNotEqualTo
Checks that the value is not equal to a given object.- Parameters:
other- The object- Throws:
InvalidObjectException- If the value is equal to the object
-
isNotNull
Checks that the value is not null.- Throws:
InvalidObjectException- If the value isnull.
-
self
-
getDefaultName
-