public class LocalDateConverter extends AbstractErpTypeConverter<LocalDate>
LocalDate
.Modifier and Type | Field and Description |
---|---|
static LocalDateConverter |
INSTANCE
Statically created instance of this converter.
|
static String |
PATTERN_WITH_DASHES
DateTimeFormat pattern suited for the date format 2018-12-31
|
static String |
PATTERN_WITHOUT_DELIMITER
DateTimeFormat pattern suited for the date format 20181231
|
Constructor and Description |
---|
LocalDateConverter()
Creates an instance that formats
LocalTime instances with the pattern PATTERN_WITHOUT_DELIMITER . |
LocalDateConverter(String pattern)
Creates an instance with the given pattern.
|
Modifier and Type | Method and Description |
---|---|
ConvertedObject<LocalDate> |
fromDomainNonNull(String domainObject)
Actual converter implementation from a domain-specific object to an arbitrary type.
|
Class<LocalDate> |
getType()
Getter for an class object of the type to convert from/to the domain-specific counterpart.
|
ConvertedObject<String> |
toDomainNonNull(LocalDate object)
Actual converter implementation from an arbitrary object to its domain-specific counterpart.
|
getDomainType
fromDomain, toDomain
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fromDomain, toDomain
public static final LocalDateConverter INSTANCE
public static final String PATTERN_WITHOUT_DELIMITER
public static final String PATTERN_WITH_DASHES
public LocalDateConverter()
LocalTime
instances with the pattern PATTERN_WITHOUT_DELIMITER
.
For parsing, the format depends on the input String. If the input String contains "-",
PATTERN_WITH_DASHES
is used; otherwise, PATTERN_WITHOUT_DELIMITER
is used.public LocalDateConverter(@Nullable String pattern)
pattern
- The pattern for LocalTime
. if null
, this constructor creates an instance that formats
LocalTime
instances with the pattern PATTERN_WITHOUT_DELIMITER
. For parsing, the
format depends on the input String. If the input String contains "-", PATTERN_WITH_DASHES
is
used; otherwise, PATTERN_WITHOUT_DELIMITER
is used.@Nonnull public Class<LocalDate> getType()
T
.@Nonnull public ConvertedObject<String> toDomainNonNull(@Nonnull LocalDate object)
toDomainNonNull
in class AbstractTypeConverter<LocalDate,String>
object
- The object to transform to its domain-specific counterpart.@Nonnull public ConvertedObject<LocalDate> fromDomainNonNull(@Nonnull String domainObject)
fromDomainNonNull
in class AbstractTypeConverter<LocalDate,String>
domainObject
- The domain-specific object to transform.Copyright © 2018 SAP SE. All rights reserved.