Class Migration.MigrationResult<TResult>

  • Type Parameters:
    TResult - the result type of the operation
    Enclosing class:
    Migration<TReadResult,​TWriteResult,​TReadInput,​TWriteInput>

    public static final class Migration.MigrationResult<TResult>
    extends java.lang.Object
    This class represents the result of a migration operation.

    In the case of a read operation the result will be this type. Write operations may need to return multiple results and therefore use the Migration.MigrationWriteResult type.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.Exception> getException()
      Get the exception associated with the result or an empty optional if there was no exception.
      MigrationOrigin getOrigin()
      Get the origin associated with the result.
      java.util.Optional<TResult> getResult()
      The result.
      boolean isSuccess()
      Check if the operation was a success.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MigrationResult

        public MigrationResult​(boolean success,
                               @NotNull
                               MigrationOrigin origin,
                               @Nullable
                               TResult result,
                               @Nullable
                               java.lang.Exception exception)
    • Method Detail

      • isSuccess

        public boolean isSuccess()
        Check if the operation was a success.
        Returns:
        true if the operation was a success
      • getOrigin

        public MigrationOrigin getOrigin()
        Get the origin associated with the result.
        Returns:
        The origin of the result.
      • getResult

        public java.util.Optional<TResult> getResult()
        The result. This may be an empty optional if an error occurred.
        Returns:
        The result, or an empty optional if no result was generated.
      • getException

        public java.util.Optional<java.lang.Exception> getException()
        Get the exception associated with the result or an empty optional if there was no exception.

        A result may not be successful, but may also not have an exception associated with it.

        Returns:
        the exception, or an empty optional if no result was produced