public class LocalTimeConverter extends AbstractErpTypeConverter<LocalTime>
LocalTime
.Modifier and Type | Field and Description |
---|---|
static LocalTimeConverter |
INSTANCE
Statically created instance of this converter.
|
static String |
PATTERN_WITH_COLONS
DateTimeFormat pattern suited for the time format 17:34:56
|
static String |
PATTERN_WITHOUT_DELIMITER
DateTimeFormat pattern suited for the time format 173456
|
Constructor and Description |
---|
LocalTimeConverter()
Creates an instance that formats
LocalTime instances with the pattern PATTERN_WITHOUT_DELIMITER . |
LocalTimeConverter(String pattern)
Creates an instance with the given pattern.
|
Modifier and Type | Method and Description |
---|---|
ConvertedObject<LocalTime> |
fromDomainNonNull(String domainObject)
Actual converter implementation from a domain-specific object to an arbitrary type.
|
Class<LocalTime> |
getType()
Getter for an class object of the type to convert from/to the domain-specific counterpart.
|
ConvertedObject<String> |
toDomainNonNull(LocalTime 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 LocalTimeConverter INSTANCE
public static final String PATTERN_WITH_COLONS
public static final String PATTERN_WITHOUT_DELIMITER
public LocalTimeConverter()
LocalTime
instances with the pattern PATTERN_WITHOUT_DELIMITER
.
For parsing, the format depends on the input String. If the input String contains ":",
PATTERN_WITH_COLONS
is used; otherwise, PATTERN_WITHOUT_DELIMITER
is used.public LocalTimeConverter(@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_COLONS
is
used; otherwise, PATTERN_WITHOUT_DELIMITER
is used.@Nonnull public Class<LocalTime> getType()
TypeConverter
T
.@Nonnull public ConvertedObject<String> toDomainNonNull(@Nonnull LocalTime object)
AbstractTypeConverter
toDomainNonNull
in class AbstractTypeConverter<LocalTime,String>
object
- The object to transform to its domain-specific counterpart.@Nonnull public ConvertedObject<LocalTime> fromDomainNonNull(@Nonnull String domainObject)
AbstractTypeConverter
fromDomainNonNull
in class AbstractTypeConverter<LocalTime,String>
domainObject
- The domain-specific object to transform.Copyright © 2020 SAP SE. All rights reserved.