Package ch.kk7.confij.binding.values
Class PeriodMapper.PeriodMapperInstance
java.lang.Object
ch.kk7.confij.binding.values.PeriodMapper.PeriodMapperInstance
- All Implemented Interfaces:
ValueMapperInstance<java.time.Period>,ValueMapperInstance.NullableValueMapperInstance<java.time.Period>
- Enclosing class:
- PeriodMapper
public static class PeriodMapper.PeriodMapperInstance extends java.lang.Object implements ValueMapperInstance.NullableValueMapperInstance<java.time.Period>
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.kk7.confij.binding.values.ValueMapperInstance
ValueMapperInstance.NullableValueMapperInstance<T> -
Constructor Summary
Constructors Constructor Description PeriodMapperInstance() -
Method Summary
Modifier and Type Method Description java.time.PeriodfromNonNullString(java.lang.String string)static java.time.PeriodparsePeriod(java.lang.String s)Parses a period string.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.kk7.confij.binding.values.ValueMapperInstance.NullableValueMapperInstance
fromString
-
Constructor Details
-
PeriodMapperInstance
public PeriodMapperInstance()
-
-
Method Details
-
parsePeriod
public static java.time.Period parsePeriod(java.lang.String s)Parses a period string. If no units are specified in the string, it is assumed to be in days. The returned period is in days. The purpose of this function is to implement the period-related methods in the ConfigObject interface.Heavily inspired by https://github.com/lightbend/config/blob/ea45ea3767a201933eeeb9c3f0f13eacc9b51f07/config/src/main/java/com/typesafe/config/impl/SimpleConfig.java
-
fromNonNullString
public java.time.Period fromNonNullString(java.lang.String string)- Specified by:
fromNonNullStringin interfaceValueMapperInstance.NullableValueMapperInstance<java.time.Period>
-