Class Migration.MigrationResult<TResult>
- java.lang.Object
-
- com.launchdarkly.sdk.server.migrations.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.
-
-
Constructor Summary
Constructors Constructor Description MigrationResult(boolean success, MigrationOrigin origin, TResult result, java.lang.Exception exception)
-
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.
-
-
-
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
-
-