public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static void |
convertStringAttributesToConstants(String sourceLabel,
Map<String,String> stringAttributes,
Map<String,Object> fetchResultConstants)
Converts constants stored in strings.properties to
FetchResults
constants. |
static FetchResults |
createEmtpyFetchResults(long step,
Map<String,Object> constants) |
static void |
fillMissingValues(FetchResults fetchResults,
List<Source> sources)
Enrich the
fetchResults with NaN values for all sources which do not have values in the fetchResults . |
static Double |
toDouble(Object o)
Attempts to cast an arbitrary object to a Double.
|
public static Double toDouble(Object o)
NullPointerException
- when o is nullNumberFormatException
- when the cast failspublic static void convertStringAttributesToConstants(String sourceLabel, Map<String,String> stringAttributes, Map<String,Object> fetchResultConstants)
FetchResults
constants.
Keys are prefix with the source label in order to avoid collisions.
Values are converted to doubles when possible to allows the to be used by the ExpressionEngine
.public static void fillMissingValues(FetchResults fetchResults, List<Source> sources)
fetchResults
with NaN values for all sources
which do not have values in the fetchResults
.fetchResults
- sources
- public static FetchResults createEmtpyFetchResults(long step, Map<String,Object> constants)
Copyright © 2021. All rights reserved.