final EntryType entryType = EntryType.guessFromPath(targetPath); final String content; try {
@Override public int hashCode() { return (revision.hashCode() * 31 + type.hashCode()) * 31 + content.hashCode(); }
/** * Creates a new instance. */ private MergedEntry(Revision revision, EntryType type, T content, Iterable<String> paths) { this.revision = requireNonNull(revision, "revision"); this.type = requireNonNull(type, "type"); requireNonNull(content, "content"); final Class<?> entryType = type.type(); checkArgument(entryType.isAssignableFrom(content.getClass()), "content type: %s (expected: %s)", content.getClass(), entryType); this.content = content; this.paths = ImmutableList.copyOf(requireNonNull(paths, "paths")); }
static EntryDto convert(Entry<?> entry) { final EntryDto dto = new EntryDto(); dto.setRevision(entry.revision().text()); dto.setPath(entry.path()); dto.setType(entry.type().name()); dto.setContent(entry.contentAsText()); return dto; }
static EntryDto convert(Entry<?> entry) { final EntryDto dto = new EntryDto(); dto.setRevision(entry.revision().text()); dto.setPath(entry.path()); dto.setType(entry.type().name()); dto.setContent(entry.contentAsText()); return dto; }
final EntryType entryType = EntryType.guessFromPath(targetPath); final String content; try {
/** * Creates a new instance. */ private MergedEntry(Revision revision, EntryType type, T content, Iterable<String> paths) { this.revision = requireNonNull(revision, "revision"); this.type = requireNonNull(type, "type"); requireNonNull(content, "content"); final Class<?> entryType = type.type(); checkArgument(entryType.isAssignableFrom(content.getClass()), "content type: %s (expected: %s)", content.getClass(), entryType); this.content = content; this.paths = ImmutableList.copyOf(requireNonNull(paths, "paths")); }
@Override public int hashCode() { return (revision.hashCode() * 31 + type.hashCode()) * 31 + path.hashCode(); }
static EntryDto convert(Entry<?> entry) { final EntryDto dto = new EntryDto(); dto.setRevision(entry.revision().text()); dto.setPath(entry.path()); dto.setType(entry.type().name()); dto.setContent(entry.contentAsText()); return dto; }
final EntryType entryType = EntryType.guessFromPath(targetPath); final String content; try {
/** * Creates a new instance. * * @param revision the revision of the entry * @param path the path of the entry * @param type the type of given {@code content} * @param content an object of given type {@code T} */ private Entry(Revision revision, String path, EntryType type, @Nullable T content) { requireNonNull(revision, "revision"); checkArgument(!revision.isRelative(), "revision: %s (expected: absolute revision)", revision); this.revision = revision; this.path = requireNonNull(path, "path"); this.type = requireNonNull(type, "type"); final Class<?> entryContentType = type.type(); if (entryContentType == Void.class) { checkArgument(content == null, "content: %s (expected: null)", content); this.content = null; } else { @SuppressWarnings("unchecked") final T castContent = (T) entryContentType.cast(requireNonNull(content, "content")); this.content = castContent; } }
@Override public int hashCode() { return (revision.hashCode() * 31 + type.hashCode()) * 31 + path.hashCode(); }
final EntryType entryType = EntryType.guessFromPath(path); if (fetchContent) { final byte[] content = reader.open(treeWalk.getObjectId(0)).getBytes();
/** * Creates a new instance. * * @param revision the revision of the entry * @param path the path of the entry * @param type the type of given {@code content} * @param content an object of given type {@code T} */ private Entry(Revision revision, String path, EntryType type, @Nullable T content) { requireNonNull(revision, "revision"); checkArgument(!revision.isRelative(), "revision: %s (expected: absolute revision)", revision); this.revision = revision; this.path = requireNonNull(path, "path"); this.type = requireNonNull(type, "type"); final Class<?> entryContentType = type.type(); if (entryContentType == Void.class) { checkArgument(content == null, "content: %s (expected: null)", content); this.content = null; } else { @SuppressWarnings("unchecked") final T castContent = (T) entryContentType.cast(requireNonNull(content, "content")); this.content = castContent; } }
@Override public int hashCode() { return (revision.hashCode() * 31 + type.hashCode()) * 31 + content.hashCode(); }
final EntryType entryType = EntryType.guessFromPath(path); if (fetchContent) { final byte[] content = reader.open(treeWalk.getObjectId(0)).getBytes();
/** * Creates a new instance. * * @param revision the revision of the entry * @param path the path of the entry * @param type the type of given {@code content} * @param content an object of given type {@code T} */ private Entry(Revision revision, String path, EntryType type, @Nullable T content) { requireNonNull(revision, "revision"); checkArgument(!revision.isRelative(), "revision: %s (expected: absolute revision)", revision); this.revision = revision; this.path = requireNonNull(path, "path"); this.type = requireNonNull(type, "type"); final Class<?> entryContentType = type.type(); if (entryContentType == Void.class) { checkArgument(content == null, "content: %s (expected: null)", content); this.content = null; } else { @SuppressWarnings("unchecked") final T castContent = (T) entryContentType.cast(requireNonNull(content, "content")); this.content = castContent; } }
@Override public int hashCode() { return (revision.hashCode() * 31 + type.hashCode()) * 31 + path.hashCode(); }
final EntryType entryType = EntryType.guessFromPath(path); if (fetchContent) { final byte[] content = reader.open(treeWalk.getObjectId(0)).getBytes();
switch (EntryType.guessFromPath(localPath)) { case JSON: final JsonNode jsonNode = Jackson.readTree(content);