@Test public void testStartValue() { ContentValues values = new ContentValues(1); values.put(TaskContract.Instances.INSTANCE_START, 10); assertThat(new Enduring(() -> new ContentValues(values)), hasValue(new ContentValuesWithLong(TaskContract.Instances.INSTANCE_DURATION, nullValue(Long.class)))); assertThat(new Enduring(() -> new ContentValues(values)).value().size(), is(2)); }
@Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_DUE)), (start, due) -> due - start), () -> null).value()); return values; }
Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_DUE)), (start, due) -> due - start), () -> null).value()); return values; } }
Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_DUE)), (start, due) -> due - start), () -> null).value()); return values; } Enduring(Single<ContentValues> delegate); }
Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_DUE)), (start, due) -> due - start), () -> null).value()); return values; } Enduring(Single<ContentValues> delegate); @Override ContentValues value(); }
Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_DUE)), (start, due) -> due - start), () -> null).value()); return values; } Enduring(Single<ContentValues> delegate); @Override ContentValues value();  }