Class BulkCreateResult<M extends MorpheusModel>

java.lang.Object
com.morpheusdata.core.BulkCreateResult<M>
Type Parameters:
M - the MorpheusModel class this object represents
Direct Known Subclasses:
BulkSaveResult

public class BulkCreateResult<M extends MorpheusModel> extends Object
A serializable representation of the results of bulk creating Model objects for persistence
Since:
0.15.2
  • Field Details

    • errorCode

      protected String errorCode
      An i18n Property key representing a String localized error message.
  • Constructor Details

    • BulkCreateResult

      public BulkCreateResult(String msg, String errorCode, List<M> persistedItems, List<M> failedItems)
  • Method Details

    • getSuccess

      public Boolean getSuccess()
      A helper method for determining whether the operation was fully successful.
      Returns:
      the success state of the operation
    • hasFailures

      public Boolean hasFailures()
      A helper method for checking if there were failed items as part of the operation.
      Returns:
      the failure state of the operation
    • hasPersistedItems

      public Boolean hasPersistedItems()
      A helper method for checking if there aer persisted items or not
      Returns:
    • getErrorCode

      public String getErrorCode()
      Gets an i18n Property key representing a String localized error message.
      Returns:
      An i18n Property key representing a String localized error message.
    • getPersistedItems

      public List<M> getPersistedItems()
      Gets a collection of the persisted MorpheusModel objects.
      Returns:
      A List of MorpheusModel objects that were successfully persisted. Also including their result identifier.
    • getFailedItems

      public List<M> getFailedItems()
      Gets a collection of the failed MorpheusModel objects.
      Returns:
      A List of MorpheusModel objects that failed ot persist.
    • getMsg

      public String getMsg()
      Returns an optional message string containing more error details in a humange readable form. Ideally an errorCode would be used for localization.
      Returns:
      an optional error message