Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* 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
You can’t perform that action at this time.