Class PresentationStringConverter
java.lang.Object
hu.rts.mike.example.dev.crm.converter.PresentationStringConverter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconcatWithAffixes(String prefix, String value, String suffix) concatWithPrefix(String prefix, String value) concatWithSuffix(String value, String suffix) fromDateLocalized(LocalDate value) Converts aLocalDateto a localized string representation using the current Locale.fromDateTimeLocalized(Instant value) Converts anInstantvalue to a localized string representation of date-time using the current Locale and time zone offset (in seconds).fromDoubleDecimal(Double value) Converts aDoublevalue to a localized string representation using the current Locale.fromInteger(Integer value) Converts anIntegervalue to a string representation.Gets the date format pattern (pattern for formatting dates) for the current Locale.Gets a DateTimeFormatter instance for formatting dates based on the current Locale.Gets the date-time format pattern (pattern for formatting date-time values) for the current Locale.Gets a DateTimeFormatter instance for formatting date-time values based on the current Locale.Gets a DecimalFormat instance based on the current Locale.nullSafeString(Object value) Returns a non-null string value or a default "-" string if the provided value is null.
-
Constructor Details
-
PresentationStringConverter
public PresentationStringConverter()
-
-
Method Details
-
getDecimalFormat
Gets a DecimalFormat instance based on the current Locale.- Returns:
- The DecimalFormat instance with the proper symbols for the current Locale.
-
getDateFormatter
Gets a DateTimeFormatter instance for formatting dates based on the current Locale.- Returns:
- The DateTimeFormatter instance with the appropriate date format pattern for the current Locale.
-
getDateTimeFormatter
Gets a DateTimeFormatter instance for formatting date-time values based on the current Locale.- Returns:
- The DateTimeFormatter instance with the appropriate date-time format pattern for the current Locale.
-
getDateFormatPattern
Gets the date format pattern (pattern for formatting dates) for the current Locale.- Returns:
- The date format pattern as a string for the current Locale.
-
getDateTimeFormatPattern
Gets the date-time format pattern (pattern for formatting date-time values) for the current Locale.- Returns:
- The date-time format pattern as a string for the current Locale.
-
fromDateLocalized
Converts aLocalDateto a localized string representation using the current Locale. -
fromDateTimeLocalized
Converts anInstantvalue to a localized string representation of date-time using the current Locale and time zone offset (in seconds). -
fromDoubleDecimal
Converts aDoublevalue to a localized string representation using the current Locale. -
fromInteger
Converts anIntegervalue to a string representation. -
nullSafeString
Returns a non-null string value or a default "-" string if the provided value is null.- Parameters:
value- The object value to be checked for null.- Returns:
- String value of the provided object if not null, or "-" if the value is null.
-
concatWithAffixes
- Returns:
- a string which concatenates the given value with prefix and suffix. If the value is null, empty or "-" it returns an empty string.
-
concatWithPrefix
- Returns:
- a string which concatenates the given value with prefix. If the value is null, empty or "-" it returns an empty string.
-
concatWithSuffix
- Returns:
- a string which concatenates the given value with suffix. If the value is null, empty or "-" it returns an empty string.
-