@Test public void testCalendar() { Date now = new Date(); StringDerivedProperty<Date> calendarProperty = new StringDerivedProperty<Date>("myproperty", now, new Function<String, Date>() { @Override public Date apply(@Nullable String input) { Date d = new Date(); try { d.setTime(Long.parseLong(input)); } catch (Exception e) { return new Date(0); } return d; } }); assertEquals(now, calendarProperty.getValue()); Date newTime = new Date(); newTime.setTime(now.getTime() + 60000); ConfigurationManager.getConfigInstance().setProperty("myproperty", String.valueOf(newTime.getTime())); assertEquals(newTime, calendarProperty.getValue()); }
@Override public T getValue() { return derivedValue; }
StringDerivedProperty extends PropertyWrapper<T> { @Override public T getValue() { return derivedValue; } }
StringDerivedProperty extends PropertyWrapper<T> { @Override public T getValue() { return derivedValue; } StringDerivedProperty(String propName, T defaultValue, Function<String, T> decoder); }
StringDerivedProperty extends PropertyWrapper<T> { @Override public T getValue() { return derivedValue; } StringDerivedProperty(String propName, T defaultValue, Function<String, T> decoder); @Override T getValue(); }
StringDerivedProperty extends PropertyWrapper<T> { @Override public T getValue() { return derivedValue; } StringDerivedProperty(String propName, T defaultValue, Function<String, T> decoder); @Override T getValue();  }