com.notuvy.xml
Class XmlIOStatus<T>
java.lang.Object
com.notuvy.xml.XmlIOStatus<T>
public class XmlIOStatus<T>
- extends Object
The result of an IO operation.
Instead of returning a simple boolean success flag, IO operation can return this object
which encapsulates the boolean flag, plus also holds a descriptive error message for
the failure case.
If the operation produces a return value, it can be returned in the payload.
- Author:
- murali
Constructor Summary |
XmlIOStatus(String pErrorMessage,
T pValue)
Create a failure response with the given payload. |
XmlIOStatus(T pValue)
Create a successful response with the given payload. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlIOStatus
public XmlIOStatus(T pValue)
- Create a successful response with the given payload.
- Parameters:
pValue
- The return value of the operation.
XmlIOStatus
public XmlIOStatus(String pErrorMessage,
T pValue)
- Create a failure response with the given payload.
- Parameters:
pErrorMessage
- The description of the error.pValue
- The return value of the operation.
success
public static XmlIOStatus<Void> success()
failure
public static XmlIOStatus<Void> failure(String pErrorMessage)
failure
public static XmlIOStatus<Void> failure()
isSuccess
public boolean isSuccess()
getErrorMessage
public String getErrorMessage()
getValue
public T getValue()
Copyright © 2013. All Rights Reserved.