@Test public void testReduceToFieldSpec_withNotNull_reducesToSpec() { OffsetDateTime value = OffsetDateTime.of(2000, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); DataBagValue generatedValue = new DataBagValue(value); FieldSpec result = equalToDateRelations.createModifierFromOtherValue(generatedValue); FieldSpec expected = FieldSpecFactory.fromList(DistributedList.singleton(value)); assertThat(result, sameBeanAs(expected)); }
@Override public FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue) { if (otherFieldGeneratedValue.getValue() == null){ return FieldSpecFactory.nullOnly(); } return FieldSpecFactory.fromList(DistributedList.singleton(otherFieldGeneratedValue.getValue())); }
EqualToRelation implements FieldSpecRelation { @Override public FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue) { if (otherFieldGeneratedValue.getValue() == null){ return FieldSpecFactory.nullOnly(); } return FieldSpecFactory.fromList(DistributedList.singleton(otherFieldGeneratedValue.getValue())); } }
EqualToRelation implements FieldSpecRelation { @Override public FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue) { if (otherFieldGeneratedValue.getValue() == null){ return FieldSpecFactory.nullOnly(); } return FieldSpecFactory.fromList(DistributedList.singleton(otherFieldGeneratedValue.getValue())); } EqualToRelation(Field main, Field other); }
EqualToRelation implements FieldSpecRelation { @Override public FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue) { if (otherFieldGeneratedValue.getValue() == null){ return FieldSpecFactory.nullOnly(); } return FieldSpecFactory.fromList(DistributedList.singleton(otherFieldGeneratedValue.getValue())); } EqualToRelation(Field main, Field other); @Override FieldSpec createModifierFromOtherFieldSpec(FieldSpec otherFieldSpec); @Override FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue); @Override FieldSpecRelation inverse(); @Override Field main(); @Override Field other(); @Override Constraint negate(); }
EqualToRelation implements FieldSpecRelation { @Override public FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue) { if (otherFieldGeneratedValue.getValue() == null){ return FieldSpecFactory.nullOnly(); } return FieldSpecFactory.fromList(DistributedList.singleton(otherFieldGeneratedValue.getValue())); } EqualToRelation(Field main, Field other); @Override FieldSpec createModifierFromOtherFieldSpec(FieldSpec otherFieldSpec); @Override FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue); @Override FieldSpecRelation inverse(); @Override Field main(); @Override Field other(); @Override Constraint negate();  }