@Test void testEquals() { final Entry<Void> e = Entry.ofDirectory(new Revision(1), "/foo"); assertThat(e).isNotEqualTo(null); assertThat(e).isNotEqualTo(new Object()); assertThat(e).isEqualTo(e); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Entry)) { return false; } @SuppressWarnings("unchecked") final Entry<T> that = (Entry<T>) o; return type == that.type && revision.equals(that.revision) && path.equals(that.path) && Objects.equals(content, that.content); }
Entry implements ContentHolder<T> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Entry)) { return false; } @SuppressWarnings("unchecked") final Entry<T> that = (Entry<T>) o; return type == that.type && revision.equals(that.revision) && path.equals(that.path) && Objects.equals(content, that.content); } }
Entry implements ContentHolder<T> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Entry)) { return false; } @SuppressWarnings("unchecked") final Entry<T> that = (Entry<T>) o; return type == that.type && revision.equals(that.revision) && path.equals(that.path) && Objects.equals(content, that.content); } private  Entry(Revision revision, String path, EntryType type, @Nullable T content); }
Entry implements ContentHolder<T> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Entry)) { return false; } @SuppressWarnings("unchecked") final Entry<T> that = (Entry<T>) o; return type == that.type && revision.equals(that.revision) && path.equals(that.path) && Objects.equals(content, that.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> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Entry)) { return false; } @SuppressWarnings("unchecked") final Entry<T> that = (Entry<T>) o; return type == that.type && revision.equals(that.revision) && path.equals(that.path) && Objects.equals(content, that.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();  }