Class OperationAwarePersistenceMessage<T>

java.lang.Object
com.broadleafcommerce.common.messaging.PersistenceMessage<T>
com.broadleafcommerce.adminuser.user.messaging.OperationAwarePersistenceMessage<T>
Type Parameters:
T - the type of the entity on which a persistence event occurred

public class OperationAwarePersistenceMessage<T> extends com.broadleafcommerce.common.messaging.PersistenceMessage<T>
An extension of PersistenceMessage that includes an operation type field and timestamp field describing the change on the entity.
Author:
Samarth Dhruva (samarthd)
  • Constructor Summary

    Constructors
    Constructor
    Description
    OperationAwarePersistenceMessage(T entity, @NonNull com.broadleafcommerce.data.tracking.core.type.OperationType operationType, @NonNull Instant timestamp)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    com.broadleafcommerce.data.tracking.core.type.OperationType
    The type of persistence event that happened on the PersistenceMessage.getEntity().
    The timestamp of the persistence event that happened on the PersistenceMessage.getEntity().
    int
     
    of(T entity, @NonNull com.broadleafcommerce.data.tracking.core.type.OperationType operationType, @NonNull Instant timestamp)
     
     

    Methods inherited from class com.broadleafcommerce.common.messaging.PersistenceMessage

    get_baseClass, get_class, getEntity, of

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OperationAwarePersistenceMessage

      public OperationAwarePersistenceMessage(@NonNull T entity, @NonNull @NonNull com.broadleafcommerce.data.tracking.core.type.OperationType operationType, @NonNull @NonNull Instant timestamp)
  • Method Details

    • of

      public static <T> OperationAwarePersistenceMessage<T> of(@NonNull T entity, @NonNull @NonNull com.broadleafcommerce.data.tracking.core.type.OperationType operationType, @NonNull @NonNull Instant timestamp)
    • getOperationType

      public com.broadleafcommerce.data.tracking.core.type.OperationType getOperationType()
      The type of persistence event that happened on the PersistenceMessage.getEntity().
    • getTimestamp

      public Instant getTimestamp()
      The timestamp of the persistence event that happened on the PersistenceMessage.getEntity(). Useful for consumers to know ordering of events.
    • toString

      public String toString()
      Overrides:
      toString in class com.broadleafcommerce.common.messaging.PersistenceMessage<T>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class com.broadleafcommerce.common.messaging.PersistenceMessage<T>
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class com.broadleafcommerce.common.messaging.PersistenceMessage<T>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class com.broadleafcommerce.common.messaging.PersistenceMessage<T>