@Test public void testReduceToFieldSpec_withNull_reducesToSpec() { OffsetDateTime value = null; DataBagValue generatedValue = new DataBagValue(value); FieldSpec result = equalToDateRelations.createModifierFromOtherValue(generatedValue); FieldSpec expected = FieldSpecFactory.nullOnly(); 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();  }