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 77cfb038c..99661a8d6 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 BitmapIndex getBitmapIndex() throws IOException { */ @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 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 getShallowCommits() throws IOException { + return delegate().getShallowCommits(); + } + + @Override + public AsyncObjectLoaderQueue open( + Iterable 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 AsyncObjectSizeQueue getObjectSize( + Iterable 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(); + } + } }