iitb.con.util
Class Result

java.lang.Object
  extended by iitb.con.util.Result

public class Result
extends java.lang.Object

Result class holds the status of the method execution. It acts like a boolean wrapper. User can set the status as true or false with appropriate message or exception.


Field Summary
 java.lang.String ErrMessage
          Error messages of the method execution
 java.lang.Throwable Exception
          Stores exception of the method execution
 java.lang.String Message
          Information of method execution status
 java.lang.Object Object
          Stores return object
 boolean Success
          Stores true or false value of the method execution status
 
Constructor Summary
Result()
           
Result(boolean Success)
          Initializes the newly created Result with success status.
Result(boolean Success, java.lang.String message)
          Initializes the newly created Result with the failure status and error message.
Result(boolean Success, java.lang.String message, java.lang.Throwable Exception)
          Initializes the newly created Result with the failure status and error message.
 
Method Summary
static void status(Result result)
          Outputs the status of the Result object
static void status(java.lang.String msg, Result result)
          Outputs the status of the Result object along with the user's message
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ErrMessage

public java.lang.String ErrMessage
Error messages of the method execution


Exception

public java.lang.Throwable Exception
Stores exception of the method execution


Message

public java.lang.String Message
Information of method execution status


Object

public java.lang.Object Object
Stores return object


Success

public boolean Success
Stores true or false value of the method execution status

Constructor Detail

Result

public Result()

Result

public Result(boolean Success)
Initializes the newly created Result with success status.

Parameters:
Success - success status

Result

public Result(boolean Success,
              java.lang.String message)
Initializes the newly created Result with the failure status and error message.

Parameters:
Success - success status
message - error message

Result

public Result(boolean Success,
              java.lang.String message,
              java.lang.Throwable Exception)
Initializes the newly created Result with the failure status and error message.

Parameters:
Success - success status
message - error message
Method Detail

status

public static void status(Result result)
Outputs the status of the Result object

Parameters:
result - the Result object

status

public static void status(java.lang.String msg,
                          Result result)
Outputs the status of the Result object along with the user's message

Parameters:
msg - message
result - the Result object