aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
diff options
context:
space:
mode:
authorDave Borowitz <dborowitz@google.com>2016-04-25 13:28:43 -0400
committerDave Borowitz <dborowitz@google.com>2016-04-25 13:36:38 -0400
commit8a26d0577f0c5eb391d82fefec1a52c2d69bdee6 (patch)
treeeea06f1c42b159d3bab7aad800f9e9c466588e81 /org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
parent29e83d44ff415247da78504afa1bbf23deeacef4 (diff)
downloadjgit-8a26d0577f0c5eb391d82fefec1a52c2d69bdee6.tar.gz
jgit-8a26d0577f0c5eb391d82fefec1a52c2d69bdee6.zip
Add ObjectReader.Filter, like in ObjectInserter
Change-Id: If34ad8185dc8192435e622995fdca598b86add7e
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java98
1 files changed, 98 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
index 77cfb038cc..99661a8d66 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
@@ -431,4 +431,102 @@ public abstract class ObjectReader implements AutoCloseable {
*/
@Override
public abstract void close();
+
+ /**
+ * Wraps a delegate ObjectReader.
+ *
+ * @since 4.4
+ */
+ public static abstract class Filter extends ObjectReader {
+ /**
+ * @return delegate ObjectReader to handle all processing.
+ * @since 4.4
+ */
+ protected abstract ObjectReader delegate();
+
+ @Override
+ public ObjectReader newReader() {
+ return delegate().newReader();
+ }
+
+ @Override
+ public AbbreviatedObjectId abbreviate(AnyObjectId objectId)
+ throws IOException {
+ return delegate().abbreviate(objectId);
+ }
+
+ @Override
+ public AbbreviatedObjectId abbreviate(AnyObjectId objectId, int len)
+ throws IOException {
+ return delegate().abbreviate(objectId, len);
+ }
+
+ @Override
+ public Collection<ObjectId> resolve(AbbreviatedObjectId id)
+ throws IOException {
+ return delegate().resolve(id);
+ }
+
+ @Override
+ public boolean has(AnyObjectId objectId) throws IOException {
+ return delegate().has(objectId);
+ }
+
+ @Override
+ public boolean has(AnyObjectId objectId, int typeHint) throws IOException {
+ return delegate().has(objectId, typeHint);
+ }
+
+ @Override
+ public ObjectLoader open(AnyObjectId objectId)
+ throws MissingObjectException, IOException {
+ return delegate().open(objectId);
+ }
+
+ @Override
+ public ObjectLoader open(AnyObjectId objectId, int typeHint)
+ throws MissingObjectException, IncorrectObjectTypeException,
+ IOException {
+ return delegate().open(objectId, typeHint);
+ }
+
+ @Override
+ public Set<ObjectId> getShallowCommits() throws IOException {
+ return delegate().getShallowCommits();
+ }
+
+ @Override
+ public <T extends ObjectId> AsyncObjectLoaderQueue<T> open(
+ Iterable<T> objectIds, boolean reportMissing) {
+ return delegate().open(objectIds, reportMissing);
+ }
+
+ @Override
+ public long getObjectSize(AnyObjectId objectId, int typeHint)
+ throws MissingObjectException, IncorrectObjectTypeException,
+ IOException {
+ return delegate().getObjectSize(objectId, typeHint);
+ }
+
+ @Override
+ public <T extends ObjectId> AsyncObjectSizeQueue<T> getObjectSize(
+ Iterable<T> objectIds, boolean reportMissing) {
+ return delegate().getObjectSize(objectIds, reportMissing);
+ }
+
+ @Override
+ public void setAvoidUnreachableObjects(boolean avoid) {
+ delegate().setAvoidUnreachableObjects(avoid);
+ }
+
+ @Override
+ public BitmapIndex getBitmapIndex() throws IOException {
+ return delegate().getBitmapIndex();
+ }
+
+ @Override
+ public void close() {
+ delegate().close();
+ }
+ }
}