Package com.adyen.util
Class Util
- java.lang.Object
-
- com.adyen.util.Util
-
public final class Util extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcalculateSessionValidity()Calculates a session validity timestamp exactly 24 hours in the future from the current time, formatted as an ISO 8601 string in GMT.static intgetDecimalPlaces(String currency)Returns the number of decimal places typically used for a given currency code.static <T> Stringimplode(String glue, List<T> list)Joins a list of items to a single string using "glue" as separator If the item is null, it will add as emptystatic StringtoIndentedString(Object o)Converts an object to a string and indents every new line by 4 spaces, except the first line.
-
-
-
Method Detail
-
implode
public static <T> String implode(String glue, List<T> list)
Joins a list of items to a single string using "glue" as separator If the item is null, it will add as empty- Type Parameters:
T- type of elements- Parameters:
glue- separatorlist- list of elements to be joined- Returns:
- final string after concatenation
-
getDecimalPlaces
public static int getDecimalPlaces(String currency)
Returns the number of decimal places typically used for a given currency code. For example, JPY returns 0, USD returns 2, and BHD returns 3.- Parameters:
currency- the ISO 4217 currency code- Returns:
- the number of decimal places used for the currency
-
toIndentedString
public static String toIndentedString(Object o)
Converts an object to a string and indents every new line by 4 spaces, except the first line. Useful for generating indented logs or formatted output.- Parameters:
o- the object to convert- Returns:
- the indented string representation of the object; returns "null" if the object is null
-
calculateSessionValidity
public static String calculateSessionValidity()
Calculates a session validity timestamp exactly 24 hours in the future from the current time, formatted as an ISO 8601 string in GMT.- Returns:
- a string representing the session validity time in the format "yyyy-MM-dd'T'HH:mm:ssXXX"
-
-