Package com.wavefront.ingester
Class StringParser
- java.lang.Object
-
- com.wavefront.ingester.StringParser
-
public class StringParser extends Object
A lightweight parser custom-tailored to suit all of our supported line protocols.- Author:
- vasily@wavefront.com
-
-
Constructor Summary
Constructors Constructor Description StringParser(String input)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Checks whether there are more tokens available in the string.Stringnext()Retrieves the next available token and advances further.Stringpeek()Retrieves the next available token, but does not advance the further, so multiple calls to peek() return the same value.
-
-
-
Method Detail
-
peek
@Nullable public String peek()
Retrieves the next available token, but does not advance the further, so multiple calls to peek() return the same value. The value is cached so performance penalty for multiple peek() calls is negligible.- Returns:
- next available token or null if end of line is reached
-
hasNext
public boolean hasNext()
Checks whether there are more tokens available in the string.- Returns:
- true if more tokens available
-
-