Class PushServiceUtils
java.lang.Object
com.priint.pubserver.entitydata.service.PushServiceUtils
Utility class for processing and transforming `PushData` objects.
This class provides methods to convert data into a flat structure,
extract and sort various entities such as buckets, key-values, cords,
and other related data types. It also includes helper methods for
managing hierarchical relationships and avoiding duplicates.
This class is not intended to be instantiated.
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.priint.pubserver.plugin.entitydata.ConnectorEntityconnectorEntity(com.priint.pubserver.plugin.entitydata.EntityData entityData) Returns the ConnectorEntity associated with the given EntityData.static final com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushDataconvertDataToFlatStructure(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData data) Converts the given `PushData` object into a flat structure.static final com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushDataconvertDataToFlatStructure2(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData data) Converts the given `PushData` object into a flat structure.static final List<com.priint.pubserver.plugin.entitydata.ContentMetaData> extractContentMetaData(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData data) Extracts all ContentMetaData from the given PushData object and clears the original lists.static final List<com.priint.pubserver.plugin.entitydata.Bucket> getAllBuckets(com.priint.pubserver.plugin.entitydata.Bucket bucket, boolean removeChildren) Recursively retrieves all Bucket objects from the given Bucket object and its children.static final List<com.priint.pubserver.plugin.entitydata.KeyValue> getAllKeyValues(com.priint.pubserver.plugin.entitydata.KeyValue kv, boolean removeChildren) Recursively retrieves all KeyValue objects from the given KeyValue object and its children.
-
Method Details
-
convertDataToFlatStructure
public static final com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData convertDataToFlatStructure(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData data) Converts the given `PushData` object into a flat structure. This method flattens the data by extracting all entities and their relationships, avoiding duplicates and ensuring a consistent structure.- Parameters:
data- the `PushData` object to be converted- Returns:
- a new `PushData` object with a flat structure
-
convertDataToFlatStructure2
public static final com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData convertDataToFlatStructure2(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData data) Converts the given `PushData` object into a flat structure. This method flattens the data by extracting all entities and their relationships, avoiding duplicates and ensuring a consistent structure.- Parameters:
data- the `PushData` object to be converted- Returns:
- a new `PushData` object with a flat structure
-
getAllBuckets
public static final List<com.priint.pubserver.plugin.entitydata.Bucket> getAllBuckets(com.priint.pubserver.plugin.entitydata.Bucket bucket, boolean removeChildren) Recursively retrieves all Bucket objects from the given Bucket object and its children.- Parameters:
bucket- the Bucket object to start fromremoveChildren- whether to remove child Bucket objects from the original object- Returns:
- a list of all Bucket objects
-
getAllKeyValues
public static final List<com.priint.pubserver.plugin.entitydata.KeyValue> getAllKeyValues(com.priint.pubserver.plugin.entitydata.KeyValue kv, boolean removeChildren) Recursively retrieves all KeyValue objects from the given KeyValue object and its children.- Parameters:
kv- the KeyValue object to start fromremoveChildren- whether to remove child KeyValue objects from the original object- Returns:
- a list of all KeyValue objects
-
extractContentMetaData
public static final List<com.priint.pubserver.plugin.entitydata.ContentMetaData> extractContentMetaData(com.priint.pubserver.plugin.interfaces.ConnectorPersistRemote.PushData data) Extracts all ContentMetaData from the given PushData object and clears the original lists.- Parameters:
data- the PushData object- Returns:
- a list of extracted ContentMetaData
-
connectorEntity
public static com.priint.pubserver.plugin.entitydata.ConnectorEntity connectorEntity(com.priint.pubserver.plugin.entitydata.EntityData entityData) Returns the ConnectorEntity associated with the given EntityData.- Parameters:
entityData- the EntityData object- Returns:
- the ConnectorEntity associated with the EntityData
- Throws:
IllegalArgumentException- if the input type is not allowed
-