public class FormatUtils
extends java.lang.Object
| Constructor and Description |
|---|
FormatUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
formatApproaches(java.util.List<java.lang.String> approaches)
Converts String list with approaches values to a string ready for API consumption.
|
static java.lang.String |
formatBearings(java.util.List<java.util.List<java.lang.Double>> bearings)
Formats the bearing variables from the raw values to a string which can than be used for the
request URL.
|
static java.lang.String |
formatCoordinate(double coordinate)
Useful to remove any trailing zeros and prevent a coordinate being over 7 significant figures.
|
static java.lang.String |
formatCoordinates(java.util.List<ai.nextbillion.kits.geojson.Point> coordinates)
Converts a list of Points to String.
|
static java.lang.String |
formatDistributions(java.util.List<java.lang.Integer[]> distributions)
Converts the list of integer arrays to a string ready for API consumption.
|
static java.lang.String |
formatPointsList(java.util.List<ai.nextbillion.kits.geojson.Point> points)
Converts array of Points with waypoint_targets values to a string ready for API consumption.
|
static java.lang.String |
formatRadiuses(java.util.List<java.lang.Double> radiuses)
Used in various APIs to format the user provided radiuses to a String matching the APIs
format.
|
static java.lang.String |
formatWaypointNames(java.util.List<java.lang.String> waypointNames)
Converts String list with waypoint_names values to a string ready for API consumption.
|
static java.lang.String |
join(java.lang.CharSequence delimiter,
java.util.List<?> tokens)
Returns a string containing the tokens joined by delimiters.
|
static java.lang.String |
join(java.lang.CharSequence delimiter,
java.util.List<?> tokens,
boolean removeTrailingNulls)
Returns a string containing the tokens joined by delimiters.
|
@Nullable
public static java.lang.String join(@NonNull
java.lang.CharSequence delimiter,
@Nullable
java.util.List<?> tokens)
delimiter - the delimiter on which to split.tokens - A list of objects to be joined. Strings will be formed from the objects by
calling object.toString().String@Nullable
public static java.lang.String join(@NonNull
java.lang.CharSequence delimiter,
@Nullable
java.util.List<?> tokens,
boolean removeTrailingNulls)
delimiter - the delimiter on which to split.tokens - A list of objects to be joined. Strings will be formed from the objects by
calling object.toString().removeTrailingNulls - true if trailing nulls should be removed.String@NonNull public static java.lang.String formatCoordinate(double coordinate)
coordinate - a double value representing a coordinate.@Nullable
public static java.lang.String formatRadiuses(@Nullable
java.util.List<java.lang.Double> radiuses)
radiuses - a list of doubles represents the radius values@Nullable
public static java.lang.String formatBearings(@Nullable
java.util.List<java.util.List<java.lang.Double>> bearings)
bearings - a List of list of doubles representing bearing values@Nullable
public static java.lang.String formatDistributions(@Nullable
java.util.List<java.lang.Integer[]> distributions)
distributions - the list of integer arrays representing the distribution@Nullable
public static java.lang.String formatApproaches(@Nullable
java.util.List<java.lang.String> approaches)
approaches - a list representing approaches to each coordinate.@Nullable
public static java.lang.String formatWaypointNames(@Nullable
java.util.List<java.lang.String> waypointNames)
waypointNames - a string representing approaches to each coordinate.@Nullable
public static java.lang.String formatCoordinates(@NonNull
java.util.List<ai.nextbillion.kits.geojson.Point> coordinates)
coordinates - a list of coordinates.@Nullable
public static java.lang.String formatPointsList(@Nullable
java.util.List<ai.nextbillion.kits.geojson.Point> points)
points - a list representing approaches to each coordinate.