@Test public void testToString() { String string1 = model.toString(); String string2 = "{id: 1234, name: \"TestModel\", }"; assertEquals(string2, string1); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append("id: " + getId()).append(", "); sb.append("name: \"" + getName() + "\""); sb.append(", "); if (!getTaggedValues().isEmpty()) { sb.append(", "); sb.append("taggedValues: " + getTaggedValues()); } sb.append("}"); return sb.toString(); }
Model extends ModelElement implements Visitable { @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append("id: " + getId()).append(", "); sb.append("name: \"" + getName() + "\""); sb.append(", "); if (!getTaggedValues().isEmpty()) { sb.append(", "); sb.append("taggedValues: " + getTaggedValues()); } sb.append("}"); return sb.toString(); } }
Model extends ModelElement implements Visitable { @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append("id: " + getId()).append(", "); sb.append("name: \"" + getName() + "\""); sb.append(", "); if (!getTaggedValues().isEmpty()) { sb.append(", "); sb.append("taggedValues: " + getTaggedValues()); } sb.append("}"); return sb.toString(); } Model(final Identifier id, final String name, final List<TaggedValue> taggedValues,
            final List<NamespaceOwnedElement> ownedElements); }
Model extends ModelElement implements Visitable { @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append("id: " + getId()).append(", "); sb.append("name: \"" + getName() + "\""); sb.append(", "); if (!getTaggedValues().isEmpty()) { sb.append(", "); sb.append("taggedValues: " + getTaggedValues()); } sb.append("}"); return sb.toString(); } Model(final Identifier id, final String name, final List<TaggedValue> taggedValues,
            final List<NamespaceOwnedElement> ownedElements); @Override void accept(final Visitor visitor); String getName(); List<NamespaceOwnedElement> getOwnedElements(); @Override String toString(); }
Model extends ModelElement implements Visitable { @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append("id: " + getId()).append(", "); sb.append("name: \"" + getName() + "\""); sb.append(", "); if (!getTaggedValues().isEmpty()) { sb.append(", "); sb.append("taggedValues: " + getTaggedValues()); } sb.append("}"); return sb.toString(); } Model(final Identifier id, final String name, final List<TaggedValue> taggedValues,
            final List<NamespaceOwnedElement> ownedElements); @Override void accept(final Visitor visitor); String getName(); List<NamespaceOwnedElement> getOwnedElements(); @Override String toString();  }