1 16 package org.joda.time.convert; 17 18 import org.joda.time.Chronology; 19 import org.joda.time.PeriodType; 20 import org.joda.time.ReadWritablePeriod; 21 import org.joda.time.ReadablePeriod; 22 23 30 class ReadablePeriodConverter extends AbstractConverter 31 implements PeriodConverter { 32 33 36 static final ReadablePeriodConverter INSTANCE = new ReadablePeriodConverter(); 37 38 41 protected ReadablePeriodConverter() { 42 super(); 43 } 44 45 57 public void setInto(ReadWritablePeriod duration, Object object, Chronology chrono) { 58 duration.setPeriod((ReadablePeriod) object); 59 } 60 61 69 public PeriodType getPeriodType(Object object) { 70 ReadablePeriod period = (ReadablePeriod) object; 71 return period.getPeriodType(); 72 } 73 74 80 public Class getSupportedType() { 81 return ReadablePeriod.class; 82 } 83 84 } 85 | Popular Tags |