/** * 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")); }
/** * 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")); }
/** * 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; } }
/** * 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; } }
/** * 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; } }