/*
 * Status.java
 *
 * Status: Complete, but may be expanded
 */

package utility;

/**
 * Abstract data type to be used to indicate the status of an operation.
 */
public class Status
 {
  /** Indicates an OK status. */
  public static final Status OK = new Status("OK");
  /** Indicates a generic error status. */
  public static final Status ERROR = new Status("ERROR");


  /** A human-readable description of this {@code Status} object. */
  public final String description;


  /**
   * Constructs a new {@code Status} with the given description.
   *
   * @param desc the description for this {@code Status} object.
   */
  public Status(String desc)
   { description = desc; }


  /**
   * Constructs a new {@code Status} with an empty description.
   */
  public Status()
   { this(""); }


  /**
   * Gets a {@code String} representation of this {@code Status} object.
   */
  public String toString()
   {
    if(!description.equals(""))
      return "Status [" + description + "]";
    else
      return "Status [" + String.valueOf(hashCode()) + "]";
   }
 }