Class Result

java.lang.Object
org.gridgain.dr.conversion.Result

public class Result extends Object
Represents the result of an entry transformation operation.

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();
 
  • Method Details

    • upsert

      public static Result upsert(Tuple key, Tuple value)
      Creates a Result representing 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 be null.
      value - The value tuple for the entry, must not be null.
      Returns:
      A new Result of type Result.Type.UPSERT with the specified key and value.
      Throws:
      IllegalArgumentException - if either key or value is null.
    • remove

      public static Result remove(Tuple key)
      Creates a Result representing 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 be null.
      Returns:
      A new Result of type Result.Type.REMOVE with the specified key and null value.
      Throws:
      IllegalArgumentException - if key is null.
    • skip

      public static Result skip()
      Creates a Result representing 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 Result of type Result.Type.SKIP with null key and value.
    • type

      public Result.Type type()
      Returns the result type, never null.
    • key

      @Nullable public @Nullable Tuple key()
      Returns the key tuple, or null if this is a Result.Type.SKIP result.
    • value

      @Nullable public @Nullable Tuple value()
      Returns the value tuple, or null if this is a Result.Type.REMOVE or Result.Type.SKIP result.