@Test public void testDiffElements() { ModelList list = modelList().add(1).add("3").add(true); for (ModelValue value : list) { switch (value.getValueType()) { case NUMBER: assertEquals(1, value.asValue(ModelNumber.class).getInt()); break; case STRING: assertEquals("3", value.asValue(ModelString.class).getValue()); break; case BOOLEAN: assertTrue(value.asValue(ModelBoolean.class).getValue()); break; default: fail("Expected number, string, or boolean for value type of list"); } } }
@Override public Model add() { return new DmrModel(value.add()); }
DmrModelList extends DmrModelValue implements ModelList { @Override public Model add() { return new DmrModel(value.add()); } }
DmrModelList extends DmrModelValue implements ModelList { @Override public Model add() { return new DmrModel(value.add()); } DmrModelList(ModelNode value); }
DmrModelList extends DmrModelValue implements ModelList { @Override public Model add() { return new DmrModel(value.add()); } DmrModelList(ModelNode value); @Override ModelValue get(int index); @Override T get(int index, Class<T> valueType); @Override Model add(); @Override ModelList add(String value); @Override ModelList add(int value); @Override ModelList add(long value); @Override ModelList add(double value); @Override ModelList add(BigInteger value); @Override ModelList add(BigDecimal value); @Override ModelList add(boolean value); @Override List<ModelValue> getValues(); @Override @SuppressWarnings("unchecked") List<T> getValues(Class<T> valueType); @Override Iterator<ModelValue> iterator(); @Override int size(); }
DmrModelList extends DmrModelValue implements ModelList { @Override public Model add() { return new DmrModel(value.add()); } DmrModelList(ModelNode value); @Override ModelValue get(int index); @Override T get(int index, Class<T> valueType); @Override Model add(); @Override ModelList add(String value); @Override ModelList add(int value); @Override ModelList add(long value); @Override ModelList add(double value); @Override ModelList add(BigInteger value); @Override ModelList add(BigDecimal value); @Override ModelList add(boolean value); @Override List<ModelValue> getValues(); @Override @SuppressWarnings("unchecked") List<T> getValues(Class<T> valueType); @Override Iterator<ModelValue> iterator(); @Override int size();  }