public class CommonLogFormatUtils extends Object
Constructor and Description |
---|
CommonLogFormatUtils() |
Modifier and Type | Method and Description |
---|---|
static <K,V extends Comparable<? super V>> |
findGreatestValues(Map<K,V> map,
int limit)
|
static int |
retrieveIntValue(String number,
boolean canBeMissing)
Retrieves an int value from a Common Log Format field.
|
static String |
retrieveSection(String resource)
Retrieves the web site section from a resource url.
|
static String |
retrieveString(String value)
Retrieves a
String value from a Common Log Format field and nullify it if not present
(represented by a hyphen "-"). |
public static int retrieveIntValue(String number, boolean canBeMissing) throws ParseException
number
- a String
int representationcanBeMissing
- indicates if the value can be missing and represented by a hyphen "-".ParseException
- if the number is not a valid int representation and is not a hyphen "-".public static String retrieveString(String value)
String
value from a Common Log Format field and nullify it if not present
(represented by a hyphen "-").public static String retrieveSection(String resource) throws ParseException
resource
- the full resource url value.ParseException
- if the section is not present or the url has a bad format.public static <K,V extends Comparable<? super V>> List<Map.Entry<K,V>> findGreatestValues(Map<K,V> map, int limit)
Copyright © 2019. All rights reserved.