public final class AdoptionResult extends Object
Result of an adoption operation.
Every AdoptionResult
has a non-null AdoptionResultType
.
Constructor and Description |
---|
AdoptionResult(AdoptionResultType type)
Create an
AdoptionResult with only a type and no other information. |
AdoptionResult(AdoptionResultType type,
Exception exception)
Create an
AdoptionResult with a type and cause exception. |
AdoptionResult(AdoptionResultType type,
int clusterID,
int nodeID)
Create an
AdoptionResult with a type, cluster ID, and node ID. |
Modifier and Type | Method and Description |
---|---|
int |
getClusterID()
Get the cluster ID returned by the operation, if any.
|
Exception |
getException()
Get the exception that occurred during operation execution, if any.
|
int |
getNodeID()
Get the node ID returned by the operation, if any.
|
AdoptionResultType |
getType()
Get the type of this
AdoptionResult . |
boolean |
hasClusterID()
Determine if the
AdoptionResult has an optional cluster ID parameter. |
boolean |
hasException()
Determine if the
AdoptionResult has an optional cause exception. |
boolean |
hasNodeID()
Determine if the
AdoptionResult has an optional node ID parameter. |
String |
toString() |
public AdoptionResult(AdoptionResultType type)
Create an AdoptionResult
with only a type and no other information.
public AdoptionResult(AdoptionResultType type, int clusterID, int nodeID)
Create an AdoptionResult
with a type, cluster ID, and node ID.
type
- the type of the AdoptionResult.clusterID
- the cluster ID of the owning node.nodeID
- the node ID of the owning node.public AdoptionResult(AdoptionResultType type, Exception exception)
Create an AdoptionResult
with a type and cause exception.
type
- the type of the AdoptionResult.exception
- any exception that occurred during operation execution.public boolean hasClusterID()
Determine if the AdoptionResult
has an optional cluster ID parameter.
true
if a cluster ID parameter is present, false
otherwise.public boolean hasNodeID()
Determine if the AdoptionResult
has an optional node ID parameter.
true
if a node ID parameter is present, false
otherwise.public boolean hasException()
Determine if the AdoptionResult
has an optional cause exception.
true
if an exception parameter is present, false
otherwise.public AdoptionResultType getType()
Get the type of this AdoptionResult
.
public int getClusterID()
Get the cluster ID returned by the operation, if any.
0
if none was reported.public int getNodeID()
Get the node ID returned by the operation, if any.
0
if none was reported.public Exception getException()
Get the exception that occurred during operation execution, if any.
null
if there was none.