/** * Deserializes the given bytes. * * @param bytes the function argument * @return the function result */ @Override public T apply(byte[] bytes) { return fromBytes(bytes, clazz); } }
/** * Serializes the given Object into bytes. * */ @Override public byte[] apply(Object o) { return toBytes(o); } }
/** * Create instance from no-args constructor * * @param clazz Class to create instance from * @param <T> Instance created from passed class * @return Object of type T */ public static <T> T createInstance(Class<? extends T> clazz) { return createInstance(clazz, null, null); }
/** * Deserialize a {@link ProfileConfig}. * * @param json A String containing JSON. * @return The Profile definition. * @throws IOException */ public static ProfileConfig fromJSON(String json) throws IOException { return JSONUtils.INSTANCE.load(json, ProfileConfig.class); }
/** * Serialize the profile definition to a JSON string. * * @return The Profiler configuration serialized as a JSON string. * @throws JsonProcessingException */ public String toJSON() throws JsonProcessingException { return JSONUtils.INSTANCE.toJSON(this, true); } }
public byte[] toJSONPretty(String config) throws IOException { return toJSONPretty(readTree(config)); }
@Override public void decompress(File inFile, File outFile) throws IOException { strategy.decompress(inFile, outFile); }
@Override public void compress(File inFile, File outFile) throws IOException { strategy.compress(inFile, outFile); }
@Override public boolean test(File gzipFile) { return strategy.test(gzipFile); }
/** * Deserialize a {@link ProfilerConfig}. * * @param json A String containing JSON. * @return The Profiler configuration. * @throws IOException */ public static ProfilerConfig fromJSON(String json) throws IOException { return JSONUtils.INSTANCE.load(json, ProfilerConfig.class); }
/** * Serialize a {@link ProfilerConfig} to a JSON string. * * @return The Profiler configuration serialized as a JSON string. * @throws JsonProcessingException */ public String toJSON() throws JsonProcessingException { return JSONUtils.INSTANCE.toJSON(this, true); } }
public void setProfileValue(Object profileValue) { this.profileValue = SerDeUtils.toBytes(profileValue); } }
@Override public Object deserialize(String s) throws IOException { return JSONUtils.INSTANCE.load(s, JSONUtils.MAP_SUPPLIER); }
public String toJSON() throws JsonProcessingException { return JSONUtils.INSTANCE.toJSON(this, true); }
@Override public Object deserialize(String s) throws IOException { return JSONUtils.INSTANCE.load(s, JSONUtils.MAP_SUPPLIER); }
public String toJSON() throws JsonProcessingException { return JSONUtils.INSTANCE.toJSON(this, true); }
@Override public Object deserialize(String s) throws IOException { return JSONUtils.INSTANCE.load(s, SensorEnrichmentConfig.class); }
@Override public Object deserialize(String s) throws IOException { return JSONUtils.INSTANCE.load(s, ProfilerConfig.class); }
@Override public Object deserialize(String s) throws IOException { return JSONUtils.INSTANCE.load(s, SensorParserConfig.class); }
private static Map<String, Object> convertDoc(String document) throws IOException { return JSONUtils.INSTANCE.load(document, JSONUtils.MAP_SUPPLIER); }