Class RevObject

All Implemented Interfaces:
Serializable, Comparable<AnyObjectId>
Direct Known Subclasses:
RevBlob, RevCommit, RevTag, RevTree

public abstract class RevObject extends ObjectIdOwnerMap.Entry
Base object type accessed during revision walking.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • parseHeaders

      abstract void parseHeaders(RevWalk walk) throws MissingObjectException, IncorrectObjectTypeException, IOException
      Throws:
      MissingObjectException
      IncorrectObjectTypeException
      IOException
    • parseBody

      Throws:
      MissingObjectException
      IncorrectObjectTypeException
      IOException
    • getType

      public abstract int getType()
      Get Git object type. See Constants.
      Returns:
      object type
    • getId

      public final ObjectId getId()
      Get the name of this object.
      Returns:
      unique hash of this object.
    • has

      public final boolean has(RevFlag flag)
      Test to see if the flag has been set on this object.
      Parameters:
      flag - the flag to test.
      Returns:
      true if the flag has been added to this object; false if not.
    • hasAny

      public final boolean hasAny(RevFlagSet set)
      Test to see if any flag in the set has been set on this object.
      Parameters:
      set - the flags to test.
      Returns:
      true if any flag in the set has been added to this object; false if not.
    • hasAll

      public final boolean hasAll(RevFlagSet set)
      Test to see if all flags in the set have been set on this object.
      Parameters:
      set - the flags to test.
      Returns:
      true if all flags of the set have been added to this object; false if some or none have been added.
    • add

      public final void add(RevFlag flag)
      Add a flag to this object.

      If the flag is already set on this object then the method has no effect.

      Parameters:
      flag - the flag to mark on this object, for later testing.
    • add

      public final void add(RevFlagSet set)
      Add a set of flags to this object.
      Parameters:
      set - the set of flags to mark on this object, for later testing.
    • remove

      public final void remove(RevFlag flag)
      Remove a flag from this object.

      If the flag is not set on this object then the method has no effect.

      Parameters:
      flag - the flag to remove from this object.
    • remove

      public final void remove(RevFlagSet set)
      Remove a set of flags from this object.
      Parameters:
      set - the flag to remove from this object.
    • toString

      public String toString()
      Overrides:
      toString in class AnyObjectId
    • appendCoreFlags

      protected void appendCoreFlags(StringBuilder s)
      Append a debug description of core RevFlags to a buffer.
      Parameters:
      s - buffer to append a debug description of core RevFlags onto.