/** * Set a named dimension to a string value. * * @param dimensionName the name of the dimension to set * @param dimensionValue to value for the given dimension * @return this, to facilitate chaining */ public PointBuilder set(String dimensionName, String dimensionValue) { return set(dimensionName, Value.of(dimensionValue)); }
/** * Set a named dimension to a floating point value. * * @param dimensionName the name of the dimension to set * @param dimensionValue to value for the given dimension * @return this, to facilitate chaining */ public PointBuilder set(String dimensionName, double dimensionValue) { return set(dimensionName, Value.of(dimensionValue)); }
/** * Set a named dimension to an integer value. * * @param dimensionName the name of the dimension to set * @param dimensionValue to value for the given dimension * @return this, to facilitate chaining */ public PointBuilder set(String dimensionName, long dimensionValue) { return set(dimensionName, Value.of(dimensionValue)); }
private static Tuple2<String[], Value[]> buildParameters(Map<String, ?> properties) { String[] dimensions = properties.keySet().toArray(new String[0]); Arrays.sort(dimensions); Value[] location = new Value[dimensions.length]; for (int i = 0; i < dimensions.length; ++i) { location[i] = Value.of(String.valueOf(properties.get(dimensions[i]))); } return new Tuple2<>(dimensions, location); }