1 16 package org.joda.time.convert; 17 18 import org.joda.time.Chronology; 19 import org.joda.time.DateTimeUtils; 20 import org.joda.time.Period; 21 import org.joda.time.ReadWritableInterval; 22 import org.joda.time.ReadWritablePeriod; 23 24 33 class NullConverter extends AbstractConverter 34 implements InstantConverter, PartialConverter, DurationConverter, PeriodConverter, IntervalConverter { 35 36 39 static final NullConverter INSTANCE = new NullConverter(); 40 41 44 protected NullConverter() { 45 super(); 46 } 47 48 55 public long getDurationMillis(Object object) { 56 return 0L; 57 } 58 59 68 public void setInto(ReadWritablePeriod duration, Object object, Chronology chrono) { 69 duration.setPeriod((Period) null); 70 } 71 72 82 public void setInto(ReadWritableInterval writableInterval, Object object, Chronology chrono) { 83 writableInterval.setChronology(chrono); 84 long now = DateTimeUtils.currentTimeMillis(); 85 writableInterval.setInterval(now, now); 86 } 87 88 94 public Class getSupportedType() { 95 return null; 96 } 97 98 } 99 | Popular Tags |