public final class Parser extends Object
Constructor and Description |
---|
Parser() |
Modifier and Type | Method and Description |
---|---|
static Boolean |
asBoolean(String bool)
Takes a String Boolean and returns null or as Boolean value
|
static Date |
asDate(String date)
Takes a String Date and decodes it into a date.
|
static Long |
asLong(String number)
Takes a String Numeric and returns null or the Long value
|
static Long |
asLong(String number,
Long defaultValue)
Takes a String Numeric and returns null or the Long value
|
static boolean |
isContentTypeText(String contentType)
Determines if the specified content type is text/plain or text/html.
|
static Date |
parseSimpleDate(String date)
Parse a string with format "yyyy-MM-dd HH:mm:ss" into a Date
The string format is used in Neutron Agent-List
|
static String |
toISO8601DateFormat(Date date) |
static String |
toRFC1123(Date date)
Takes a Date and returns it's equivalent in RFC 1123
|
static Date |
toRFC822DateParse(String toParse)
Parses a String in RFC 822 format into a Date object
|
public static Long asLong(String number)
number
- the number in string formpublic static Long asLong(String number, Long defaultValue)
number
- the number in string formdefaultValue
- the default value if number is nullpublic static Boolean asBoolean(String bool)
bool
- the boolean in String formpublic static Date asDate(String date)
date
- the date in String formpublic static Date parseSimpleDate(String date)
date
- - string to be parsedpublic static String toRFC1123(Date date)
date
- the date to formatpublic static Date toRFC822DateParse(String toParse)
toParse
- the date to parsepublic static boolean isContentTypeText(String contentType)
contentType
- the content typeCopyright © 2017. All rights reserved.