
com.wavefront.agent.handlers.LineDelimitedUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proxy Show documentation
Show all versions of proxy Show documentation
Service for batching and relaying metric traffic to Wavefront
package com.wavefront.agent.handlers;
import java.util.Collection;
import org.apache.commons.lang.StringUtils;
/**
* A collection of helper methods around plaintext newline-delimited payloads.
*
* @author [email protected]
*/
public abstract class LineDelimitedUtils {
static final String PUSH_DATA_DELIMITER = "\n";
private LineDelimitedUtils() {}
/**
* Split a newline-delimited payload into a string array.
*
* @param pushData payload to split.
* @return string array
*/
@Deprecated
public static String[] splitPushData(String pushData) {
return StringUtils.split(pushData, PUSH_DATA_DELIMITER);
}
/**
* Join a batch of strings into a payload string.
*
* @param pushData collection of strings.
* @return payload
*/
public static String joinPushData(Collection pushData) {
return StringUtils.join(pushData, PUSH_DATA_DELIMITER);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy