Class Result
This class encapsulates the outcome of transforming key-value entries. A result can represent one of three operations:
- UPSERT - Insert a new entry or update an existing one.
- REMOVE - Delete an entry by key.
- SKIP - Skip processing the entry (no operation).
Instances of this class are immutable and should be created using the provided static factory methods rather than direct construction:
// Create an upsert result
Result upsert = Result.upsert(keyTuple, valueTuple);
// Create a remove result
Result remove = Result.remove(keyTuple);
// Create an ignore/skip result
Result skip = Result.skip();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the type of operation represented by a Result. -
Method Summary
Modifier and TypeMethodDescription@Nullable Tuplekey()Returns the key tuple, ornullif this is aResult.Type.SKIPresult.static ResultCreates aResultrepresenting a remove operation.static Resultskip()Creates aResultrepresenting a skip/ignore operation.type()Returns the result type, nevernull.static ResultCreates aResultrepresenting an upsert operation.@Nullable Tuplevalue()
-
Method Details
-
upsert
Creates aResultrepresenting an upsert operation.Use this factory method to indicate that an entry should be inserted if it doesn't exist, or updated if it does exist. Both the key and value must be provided and non-null.
- Parameters:
key- The key tuple for the entry, must not benull.value- The value tuple for the entry, must not benull.- Returns:
- A new
Resultof typeResult.Type.UPSERTwith the specified key and value. - Throws:
IllegalArgumentException- if eitherkeyorvalueisnull.
-
remove
Creates aResultrepresenting a remove operation.Use this factory method to indicate that an entry should be deleted from the GridGain 9. Only the key needs to be provided; the value will always be null for remove operations.
- Parameters:
key- The key tuple identifying the entry to remove, must not benull.- Returns:
- A new
Resultof typeResult.Type.REMOVEwith the specified key and null value. - Throws:
IllegalArgumentException- ifkeyisnull.
-
skip
Creates aResultrepresenting a skip/ignore operation.Use this factory method to indicate that an entry should be skipped during processing with no action taken. This is useful for filtering entries in a transformation pipeline. Both key and value will be null for skip results.
- Returns:
- A new
Resultof typeResult.Type.SKIPwith null key and value.
-
type
Returns the result type, nevernull. -
key
Returns the key tuple, ornullif this is aResult.Type.SKIPresult. -
value
-