@Test void reduceValueToFieldSpec_whenValidIndex_returnFieldSpec() { FieldSpec expected = FieldSpecFactory.fromList(DistributedList.singleton("bar")); FieldSpec actual = testInstance.createModifierFromOtherValue(new DataBagValue(BigDecimal.valueOf(1))); Assert.assertEquals(expected, actual); }
@Override public FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue) { BigDecimal value = (BigDecimal) otherFieldGeneratedValue.getValue(); DistributedList<Object> newList = DistributedList.singleton(underlyingList.list().get(value.intValue())); return FieldSpecFactory.fromList(newList); }
InMapRelation implements FieldSpecRelation { @Override public FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue) { BigDecimal value = (BigDecimal) otherFieldGeneratedValue.getValue(); DistributedList<Object> newList = DistributedList.singleton(underlyingList.list().get(value.intValue())); return FieldSpecFactory.fromList(newList); } }
InMapRelation implements FieldSpecRelation { @Override public FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue) { BigDecimal value = (BigDecimal) otherFieldGeneratedValue.getValue(); DistributedList<Object> newList = DistributedList.singleton(underlyingList.list().get(value.intValue())); return FieldSpecFactory.fromList(newList); } InMapRelation(Field main, Field other, DistributedList<Object> underlyingList); }
InMapRelation implements FieldSpecRelation { @Override public FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue) { BigDecimal value = (BigDecimal) otherFieldGeneratedValue.getValue(); DistributedList<Object> newList = DistributedList.singleton(underlyingList.list().get(value.intValue())); return FieldSpecFactory.fromList(newList); } InMapRelation(Field main, Field other, DistributedList<Object> underlyingList); @Override FieldSpec createModifierFromOtherFieldSpec(FieldSpec otherFieldSpec); @Override FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue); @Override FieldSpecRelation inverse(); @Override Field main(); @Override Field other(); DistributedList<Object> getUnderlyingList(); @Override Constraint negate(); }
InMapRelation implements FieldSpecRelation { @Override public FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue) { BigDecimal value = (BigDecimal) otherFieldGeneratedValue.getValue(); DistributedList<Object> newList = DistributedList.singleton(underlyingList.list().get(value.intValue())); return FieldSpecFactory.fromList(newList); } InMapRelation(Field main, Field other, DistributedList<Object> underlyingList); @Override FieldSpec createModifierFromOtherFieldSpec(FieldSpec otherFieldSpec); @Override FieldSpec createModifierFromOtherValue(DataBagValue otherFieldGeneratedValue); @Override FieldSpecRelation inverse(); @Override Field main(); @Override Field other(); DistributedList<Object> getUnderlyingList(); @Override Constraint negate();  }