Class AdoptionResult


  • public final class AdoptionResult
    extends Object

    Result of an adoption operation. Every AdoptionResult has a non-null AdoptionResultType.

    • Constructor Detail

      • AdoptionResult

        public AdoptionResult​(AdoptionResultType type)

        Create an AdoptionResult with only a type and no other information.

      • AdoptionResult

        public AdoptionResult​(AdoptionResultType type,
                              int clusterID,
                              String nodeID)

        Create an AdoptionResult with a type, cluster ID, and node ID.

        Parameters:
        type - the type of the AdoptionResult.
        clusterID - the cluster ID of the owning node.
        nodeID - the node ID of the owning node.
      • AdoptionResult

        public AdoptionResult​(AdoptionResultType type,
                              Exception exception)

        Create an AdoptionResult with a type and cause exception.

        Parameters:
        type - the type of the AdoptionResult.
        exception - any exception that occurred during operation execution.
    • Method Detail

      • hasClusterID

        public boolean hasClusterID()

        Determine if the AdoptionResult has an optional cluster ID parameter.

        Returns:
        true if a cluster ID parameter is present, false otherwise.
      • hasNodeID

        public boolean hasNodeID()

        Determine if the AdoptionResult has an optional node ID parameter.

        Returns:
        true if a node ID parameter is present, false otherwise.
      • hasException

        public boolean hasException()

        Determine if the AdoptionResult has an optional cause exception.

        Returns:
        true if an exception parameter is present, false otherwise.
      • getType

        public AdoptionResultType getType()

        Get the type of this AdoptionResult.

        Returns:
        the adoption result type.
      • getClusterID

        public int getClusterID()

        Get the cluster ID returned by the operation, if any.

        Returns:
        the cluster ID, or 0 if none was reported.
      • getNodeID

        public int getNodeID()

        Get the node ID returned by the operation, if any.

        Returns:
        the node ID, or 0 if none was reported.
      • getRhinoNodeID

        public String getRhinoNodeID()

        Get the node ID returned by the operation, if any.

        Returns:
        the node ID, or null if none was reported.
        Since:
        Rhino 3.2
      • getException

        public Exception getException()

        Get the exception that occurred during operation execution, if any.

        Returns:
        the exception, null if there was none.