Class AbstractResult<V>

java.lang.Object
org.springframework.vault.support.AbstractResult<V>
Direct Known Subclasses:
VaultDecryptionResult, VaultEncryptionResult, VaultTransformDecodeResult, VaultTransformEncodeResult

public abstract class AbstractResult<V> extends Object
Supporting class for computation results allowing introspection of the result value. Accessing the result with get() returns either the result or throws a VaultException if the execution completed with an error.
Since:
1.1
Author:
Mark Paluch
  • Constructor Details

  • Method Details

    • isSuccessful

      public boolean isSuccessful()
      Returns true if and only if the batch operation was completed successfully. Use getCause() to obtain the actual exception if the operation completed with an error.
      Returns:
      true if the batch operation was completed successfully.
    • getCause

      @Nullable public Exception getCause()
      Returns the cause of the failed operation if the operation completed with an error.
      Returns:
      the cause of the failure or null if succeeded.
    • get

      @Nullable public V get()
      Return the result or throw a VaultException if the operation completed with an error. Use isSuccessful() to verify the success status of this result without throwing an exception.
      Returns:
      the result value.
      Throws:
      VaultException - if the operation completed with an error.
    • get0

      @Nullable protected abstract V get0()
      Returns:
      the actual result if this result completed successfully.