Interface ManipulationResult
- All Superinterfaces:
BaseResult
- All Known Subinterfaces:
InsertionBatchResult<T>
,InsertionResult
,ManipulationBatchResult<T>
- All Known Implementing Classes:
InsertionBatchResultImpl
,InsertionResultImpl
,ManipulationBatchResultImpl
,ManipulationResultImpl
The ManipulationResult interface represents the result of a manipulation operation,
such as an insert, update, or delete operation.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
changed()
Checks whether at least one row was changed.default void
Executes the given consumer if at least one row was changed.default void
ifChangedOrElse
(Consumer<Integer> changed, Consumer<ManipulationResult> notChanged) Executes the provided consumers based on the result of a manipulation operation.default void
ifEmpty
(Consumer<ManipulationResult> notChanged) Executes the given Consumer if the ManipulationResult has no changes.default boolean
Checks whether the manipulation operation was successful.int
rows()
Returns the total number of changed rows resulting from a manipulation operation.Methods inherited from interface de.chojo.sadu.queries.api.results.BaseResult
exceptions, hasExceptions
-
Method Details
-
rows
int rows()Returns the total number of changed rows resulting from a manipulation operation.- Returns:
- the total number of changed rows
-
changed
boolean changed()Checks whether at least one row was changed.- Returns:
- true if one row or more were changed
-
isSuccess
default boolean isSuccess()Checks whether the manipulation operation was successful.Success is determined by the absence of any exceptions and at least one row being changed.
- Returns:
true
if the operation was successful,false
otherwise.
-
ifChanged
Executes the given consumer if at least one row was changed.- Parameters:
consumer
- the consumer to execute if rows were changed
-
ifEmpty
Executes the given Consumer if the ManipulationResult has no changes.- Parameters:
notChanged
- the Consumer to execute
-
ifChangedOrElse
Executes the provided consumers based on the result of a manipulation operation.
-