/**
 * The outcome of an action.
 *
 */
public class Outcome {
  private boolean success;
  private String description;
  /**
   * Create a new outcome record.
   *
   * @param success whether the action succeeded
   * @param description a description of what happened
   */
  public Outcome(boolean success, String description) {
    this.success = success;
    this.description = description;
  }
  /**
   * Get the success status.
   *
   * @return the success status
   */
  public boolean getSuccess() { return success; }
  /**
   * Get the description of the outcome.
   *
   * @return the description
   */
  public String getDescription() { return description; }
  public String toString() {
    StringBuffer buf = new StringBuffer();
    if (success)
      buf.append("Success: ");
    else
      buf.append("Failure: ");
    buf.append(description);
    return buf.toString();
  }
}
