EmptyLogCursor.java

  1. /*
  2.  * Copyright (C) 2017, Google Inc. and others
  3.  *
  4.  * This program and the accompanying materials are made available under the
  5.  * terms of the Eclipse Distribution License v. 1.0 which is available at
  6.  * https://www.eclipse.org/org/documents/edl-v10.php.
  7.  *
  8.  * SPDX-License-Identifier: BSD-3-Clause
  9.  */

  10. package org.eclipse.jgit.internal.storage.reftable;

  11. import java.io.IOException;

  12. import org.eclipse.jgit.lib.ReflogEntry;

  13. /** Empty {@link LogCursor} with no results. */
  14. class EmptyLogCursor extends LogCursor {
  15.     /** {@inheritDoc} */
  16.     @Override
  17.     public boolean next() throws IOException {
  18.         return false;
  19.     }

  20.     /** {@inheritDoc} */
  21.     @Override
  22.     public String getRefName() {
  23.         return null;
  24.     }

  25.     /** {@inheritDoc} */
  26.     @Override
  27.     public long getUpdateIndex() {
  28.         return 0;
  29.     }

  30.     /** {@inheritDoc} */
  31.     @Override
  32.     public ReflogEntry getReflogEntry() {
  33.         return null;
  34.     }

  35.     /** {@inheritDoc} */
  36.     @Override
  37.     public void close() {
  38.         // Do nothing.
  39.     }
  40. }