org.gcube.data.tml.outcomes
Class AddTreeOutcome

java.lang.Object
  extended by org.gcube.data.tml.outcomes.AddTreeOutcome

public class AddTreeOutcome
extends Object

The outcome of adding a Tree to a data source.

Author:
Fabio Simeoni

Constructor Summary
AddTreeOutcome(Exception failure)
          Creates an instance with the exception raised when attempting to add a tree.
AddTreeOutcome(org.gcube.data.trees.data.Tree tree)
          Creates an instance with successfully added tree.
 
Method Summary
 Exception failure()
          Returns the exception raised when unsuccessfully adding a tree.
 boolean isFailure()
          Returns true if the outcome indicates a failure.
 boolean isSuccess()
          Returns true if the outcome indicates success.
 String toString()
           
 org.gcube.data.trees.data.Tree tree()
          Returns the successfully added tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AddTreeOutcome

public AddTreeOutcome(org.gcube.data.trees.data.Tree tree)
Creates an instance with successfully added tree.

Parameters:
tree - the tree

AddTreeOutcome

public AddTreeOutcome(Exception failure)
Creates an instance with the exception raised when attempting to add a tree.

Parameters:
failure - the exception
Method Detail

isSuccess

public boolean isSuccess()
Returns true if the outcome indicates success.

In this case, tree() is guaranteed not to be null, while failure() is guaranteed to be null

Returns:
true if the outcome indicates success, false otherwise

isFailure

public boolean isFailure()
Returns true if the outcome indicates a failure. In this case, failure() is guaranteed not to be null, while tree() is guaranteed to be null

Returns:
true if the outcome indicates a failure, false otherwise

tree

public org.gcube.data.trees.data.Tree tree()
Returns the successfully added tree.

Returns:
the tree, or null if the outcome indicates a failure

failure

public Exception failure()
Returns the exception raised when unsuccessfully adding a tree.

Returns:
the exception, or null if the outcome indicates a success

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.