Class FormParamsSupport
java.lang.Object
ru.vyarus.dropwizard.guice.test.client.builder.util.conf.FormParamsSupport
Convers form parameters into strings. With a special support for dates conversion.
- Since:
- 15.09.2025
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DateFormatDefault java.util dates formatter.static final DateTimeFormatterDefault java.time dates formatter. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringparameterToString(Object param) Format the given parameter object into string.static StringparameterToString(Object param, @Nullable DateFormat dateFormat, @Nullable DateTimeFormatter dateTimeFormat) Format the given parameter object into string.
-
Field Details
-
DEFAULT_DATE_FORMAT
Default java.util dates formatter. -
DEFAULT_DATE_TIME_FORMAT
Default java.time dates formatter.
-
-
Method Details
-
parameterToString
Format the given parameter object into string.String conversion specifics:
- Date fields string conversion could be customized with date formatters (one for java.util and other for java.time api).
- Null values converted to ""
- Collections and arrays converted to a comma-separated string of values (converted to string)
- By default, call toString on provided object
To customize date fields conversion use
parameterToString(Object, java.text.DateFormat, java.time.format.DateTimeFormatter).- Parameters:
param- Object- Returns:
- Object in string format
-
parameterToString
public static String parameterToString(Object param, @Nullable DateFormat dateFormat, @Nullable DateTimeFormatter dateTimeFormat) Format the given parameter object into string.String conversion specifics:
- Date fields string conversion could be customized with date formatters (one for java.util and other for java.time api).
- Null values converted to ""
- Collections and arrays converted to a comma-separated string of values (converted to string)
- By default, call toString on provided object
- Parameters:
param- ObjectdateFormat- java util date formatterdateTimeFormat- java time date formatter- Returns:
- Object in string format
-