@Test void of() { assertThatThrownBy(() -> Entry.of(null, "/1.txt", EntryType.TEXT, "1")) .isInstanceOf(NullPointerException.class); assertThatThrownBy(() -> Entry.of(new Revision(1), null, EntryType.TEXT, "1")) .isInstanceOf(NullPointerException.class); assertThatThrownBy(() -> Entry.of(new Revision(1), "/1.txt", null, "1")) .isInstanceOf(NullPointerException.class); assertThatThrownBy(() -> Entry.of(new Revision(1), "/1.txt", EntryType.TEXT, null)) .isInstanceOf(NullPointerException.class); assertThatThrownBy(() -> Entry.of(new Revision(1), "/1.txt", EntryType.TEXT, new Object())) .isInstanceOf(ClassCastException.class); Entry.of(new Revision(1), "/a", EntryType.DIRECTORY, null); assertThatThrownBy(() -> Entry.of(new Revision(1), "/a", EntryType.DIRECTORY, "foo")) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("expected: null"); }
public static <T> Entry<T> of(Revision revision, String path, EntryType type, @Nullable T content) { return new Entry<>(revision, path, type, content); }
Entry implements ContentHolder<T> { public static <T> Entry<T> of(Revision revision, String path, EntryType type, @Nullable T content) { return new Entry<>(revision, path, type, content); } }
Entry implements ContentHolder<T> { public static <T> Entry<T> of(Revision revision, String path, EntryType type, @Nullable T content) { return new Entry<>(revision, path, type, content); } private  Entry(Revision revision, String path, EntryType type, @Nullable T content); }
Entry implements ContentHolder<T> { public static <T> Entry<T> of(Revision revision, String path, EntryType type, @Nullable T content) { return new Entry<>(revision, path, type, content); } private  Entry(Revision revision, String path, EntryType type, @Nullable T content); static Entry<Void> ofDirectory(Revision revision, String path); static Entry<JsonNode> ofJson(Revision revision, String path, JsonNode content); static Entry<JsonNode> ofJson(Revision revision, String path, String content); static Entry<String> ofText(Revision revision, String path, String content); static Entry<T> of(Revision revision, String path, EntryType type, @Nullable T content); Revision revision(); String path(); boolean hasContent(); void ifHasContent(Consumer<? super T> consumer); @Override EntryType type(); @Override T content(); @Override String contentAsText(); @Override String contentAsPrettyText(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
Entry implements ContentHolder<T> { public static <T> Entry<T> of(Revision revision, String path, EntryType type, @Nullable T content) { return new Entry<>(revision, path, type, content); } private  Entry(Revision revision, String path, EntryType type, @Nullable T content); static Entry<Void> ofDirectory(Revision revision, String path); static Entry<JsonNode> ofJson(Revision revision, String path, JsonNode content); static Entry<JsonNode> ofJson(Revision revision, String path, String content); static Entry<String> ofText(Revision revision, String path, String content); static Entry<T> of(Revision revision, String path, EntryType type, @Nullable T content); Revision revision(); String path(); boolean hasContent(); void ifHasContent(Consumer<? super T> consumer); @Override EntryType type(); @Override T content(); @Override String contentAsText(); @Override String contentAsPrettyText(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }