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>
  • 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:
      fromNonNullString in interface ValueMapperInstance.NullableValueMapperInstance<java.time.Period>