Package com.activeviam.risk.core.utils
Class PublisherUtils
- java.lang.Object
-
- com.activeviam.risk.core.utils.PublisherUtils
-
public class PublisherUtils extends Object
Utils for publishers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PublisherUtils.GreekDimensionType
This will define which decode function will be called
-
Constructor Summary
Constructors Constructor Description PublisherUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object[]
createTupleForStore(com.qfs.store.IDatastore datastore, Map<String,Integer> translatorTupleFields, Object[] initialTuple, String store)
Creates a tuple for the required store, by attempting to extract the value for each store field from the input tuplestatic Object[]
createTupleForStore(com.qfs.store.IDatastore datastore, Map<String,Integer> translatorTupleFields, Object[] initialTuple, String store, Map<String,Object> fieldsToOverride)
Creates a tuple for the required store, by attempting to extract the value for each store field from the input tuplestatic List<Object[]>
extractDistinctTuples(Collection<Object[]> tuples)
Extracts unique tuples from an incoming list.
-
-
-
Method Detail
-
createTupleForStore
public static Object[] createTupleForStore(com.qfs.store.IDatastore datastore, Map<String,Integer> translatorTupleFields, Object[] initialTuple, String store, Map<String,Object> fieldsToOverride)
Creates a tuple for the required store, by attempting to extract the value for each store field from the input tuple- Parameters:
datastore
- The datastore objecttranslatorTupleFields
- Map holding the fields that exist in the incoming tuple and their respective indexesinitialTuple
- The initial tuple from the sourcestore
- The store for which a tuple has to be createdfieldsToOverride
- A map of any fields that have values set by the tuple publisher and those values- Returns:
- The tuple that conforms to the store format
-
createTupleForStore
public static Object[] createTupleForStore(com.qfs.store.IDatastore datastore, Map<String,Integer> translatorTupleFields, Object[] initialTuple, String store)
Creates a tuple for the required store, by attempting to extract the value for each store field from the input tuple- Parameters:
datastore
- The datastore objecttranslatorTupleFields
- Map holding the fields that exist in the incoming tuple and their respective indexesinitialTuple
- The initial tuple from the sourcestore
- The store for which a tuple has to be created- Returns:
- The tuple that conforms to the store format
-
extractDistinctTuples
public static List<Object[]> extractDistinctTuples(Collection<Object[]> tuples)
Extracts unique tuples from an incoming list. Comparison is made on all incoming fields, not based on a particular key subset.- Parameters:
tuples
- The list of tuples that contains duplicates.- Returns:
- The list of unique tuples.
-
-