DisplayData implements Serializable { public static ItemSpec<String> item(String key, @Nullable String value) { return item(key, Type.STRING, value); } private  DisplayData(Map<Identifier, Item> entries); static DisplayData none(); static DisplayData from(HasDisplayData component); static @Nullable Type inferType(@Nullable Object value); @JsonValue Collection<Item> items(); Map<Identifier, Item> asMap(); @Override int hashCode(); @Override boolean equals(@Nullable Object obj); @Override String toString(); static ItemSpec<String> item(String key, @Nullable String value); static ItemSpec<?> item(String key, @Nullable ValueProvider<?> value); static ItemSpec<Integer> item(String key, @Nullable Integer value); static ItemSpec<Long> item(String key, @Nullable Long value); static ItemSpec<Float> item(String key, @Nullable Float value); static ItemSpec<Double> item(String key, @Nullable Double value); static ItemSpec<Boolean> item(String key, @Nullable Boolean value); static ItemSpec<Instant> item(String key, @Nullable Instant value); static ItemSpec<Duration> item(String key, @Nullable Duration value); static ItemSpec<Class<T>> item(String key, @Nullable Class<T> value); static ItemSpec<T> item(String key, Type type, @Nullable T value);  }
@Test public void testItemEquality() { new EqualsTester() .addEqualityGroup(DisplayData.item("foo", "bar"), DisplayData.item("foo", "bar")) .addEqualityGroup(DisplayData.item("foo", "barz")) .testEquals(); }
@Test public void testCanSerializeItemSpecReference() { DisplayData.ItemSpec<?> spec = DisplayData.item("clazz", DisplayDataTest.class); SerializableUtils.ensureSerializable(new HoldsItemSpecReference(spec)); }