Created
February 11, 2014 17:32
-
-
Save marianogonzalez/8939788 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This class represents an individual data piece in the context of a bulk operation | |
*/ | |
public final class BulkItem<T> implements Serializable | |
{ | |
/** | |
* The item id | |
*/ | |
public Serializable getId(); | |
/** | |
* Wether or not it was successful. Notice that this should be <code>false</code> | |
* if {@link #exception} is not <code>null</code>, however there might not be an | |
* exception but the item could still not be successful for other reasons. | |
*/ | |
public boolean isSuccessful(); | |
/** | |
* Message to add context on this item. Could be an error description, a warning | |
* or simply some info related to the operation | |
*/ | |
public String getMessage(); | |
/** | |
* An optional status code | |
*/ | |
public String getStatusCode(); | |
/** | |
* An exception if the item was failed | |
*/ | |
public Exception getException(); | |
/** | |
* The actual data this entity represents | |
*/ | |
public T getPayload(); | |
/** | |
* A custom property stored under the given key | |
* | |
* @param key the key of the custom property | |
* @return a {@link Serializable} value | |
*/ | |
public Serializable getCustomProperty(String key); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment