Class JpaNotificationStateUtility
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.jpa.messaging.notification.JpaNotificationStateUtility
-
public final class JpaNotificationStateUtility extends Object
Utility class focused on easing the requirements for retrieving a list ofNotificationState
instances from the API of a domain class. This is primarily used to fulfill the contract ofTrackable.getNotificationStates()
, but can apply to any domain class implementingNotificationStateAware
.- Author:
- Jeff Fischer
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>
get(List<T> memberCollection, com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity)
Retrieve the list of associatedNotificationState
instances from the persistence store.static <T> List<T>
wrapNotificationCollection(List<T> starting)
Wrap a starting collection in a dirty detection proxy.
-
-
-
Method Detail
-
get
public static <T> List<T> get(List<T> memberCollection, com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity)
Retrieve the list of associatedNotificationState
instances from the persistence store.- Type Parameters:
T
- The generic type for the notification states- Parameters:
memberCollection
- The transient member collection from the entity instance. If this value is not null, this method will simply pass it back and not attempt to perform a retrieval.entity
- The entity instance for which associatedNotificationState
instances should be retrieved.- Returns:
- The list of retrieved notification states, or the passed in collection if the passed in collection was not null
-
wrapNotificationCollection
public static <T> List<T> wrapNotificationCollection(List<T> starting)
Wrap a starting collection in a dirty detection proxy. This proxy will keep track of mutating interactions that impact its size, or impact the state of one or more of the containedNotificationState
instances.- Type Parameters:
T
- The generic type for the notification states- Parameters:
starting
- The list to wrap- Returns:
- The wrapped collection
-
-