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()static AmountcreateAmount(String amount, String currency)Returns an Amount struct to use on requestsstatic AmountcreateAmount(BigDecimal amount, String currency)Returns an Amount struct to use on requestsstatic intgetDecimalPlaces(String currency)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)Convert the given object to string with each line indented 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
-
createAmount
public static Amount createAmount(String amount, String currency)
Returns an Amount struct to use on requests- Parameters:
amount- Defines the amountcurrency- Defines the amount currency- Returns:
- amount
-
createAmount
public static Amount createAmount(BigDecimal amount, String currency)
Returns an Amount struct to use on requests- Parameters:
amount- Defines the amountcurrency- Defines the amount currency- Returns:
- amount
-
getDecimalPlaces
public static int getDecimalPlaces(String currency)
-
toIndentedString
public static String toIndentedString(Object o)
Convert the given object to string with each line indented by 4 spaces (except the first line).- Parameters:
o- string- Returns:
- string target "\n" replacement with "\n "
-
calculateSessionValidity
public static String calculateSessionValidity()
-
-