@Override public String toString() { return String.format("%s%s:%s=%s", getPath(), getNamespace().getName(), getKey(), getValue()); } }
private Builder addItemIf(boolean condition, ItemSpec<?> spec) { if (!condition) { return this; } checkNotNull(spec, "Input display item cannot be null"); checkNotNull(spec.getValue(), "Input display value cannot be null"); if (spec.getNamespace() == null) { spec = spec.withNamespace(latestNs); } Item item = Item.create(spec, latestPath); Identifier id = Identifier.of(item.getPath(), item.getNamespace(), item.getKey()); checkArgument( !entries.containsKey(id), "Display data key (%s) is not unique within the specified path and namespace: %s%s.", item.getKey(), item.getPath(), item.getNamespace()); entries.put(id, item); return this; }
@Override protected DisplayData.Path featureValueOf(DisplayData.Item actual) { return actual.getPath(); } };