Enum Class GitDiffHeaderType

java.lang.Object
java.lang.Enum<GitDiffHeaderType>
com.atlassian.bitbucket.scm.git.command.diff.GitDiffHeaderType
All Implemented Interfaces:
Serializable, Comparable<GitDiffHeaderType>, Constable

public enum GitDiffHeaderType extends Enum<GitDiffHeaderType>
Defines the type of data which is provided by a given GitDiffHeader.
  • Enum Constant Details

    • INDEX

      public static final GitDiffHeaderType INDEX
      Index data, of the format &lt;source hash&gt;..&lt;destination hash&gt; &lt;optional mode&gt;.

      The mode is included only if it was not changed in the revision. Otherwise, separate headers provide the old and new modes and it is omitted from the index data.

    • MODE

      public static final GitDiffHeaderType MODE
      File mode, as a 6-digit octal number defining both type and permission bits, either for a source or destination.
    • PATH

      public static final GitDiffHeaderType PATH
      Path, either for a source or destination.
    • PERCENTAGE

      public static final GitDiffHeaderType PERCENTAGE
      A percentage, comprised of a rounded down integer followed by a percent sign.
  • Method Details

    • values

      public static GitDiffHeaderType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GitDiffHeaderType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isTargeted

      public boolean isTargeted()
      Retrieves a flag indicating whether this type of data requires a specific GitDiffTarget.
      Returns:
      true if a target is required; otherwise, false
    • verify

      public void verify(GitDiffTarget target)
      Verifies that the provided GitDiffTarget is valid for use with this header type.
      Parameters:
      target - the target to verify
      Throws:
      IllegalArgumentException - Thrown if the provided target is not valid for this header type.