public final enum

GitDiffHeader

extends Enum<E extends Enum<E>>
java.lang.Object
   ↳ java.lang.Enum<E extends java.lang.Enum<E>>
     ↳ com.atlassian.bitbucket.scm.git.command.diff.GitDiffHeader

Class Overview

Defines headers which may appear in git diff output. These will appear after the diff --git banner and before any hunks.

Summary

Enum Values
GitDiffHeader  COPY_FROM  Defines the source path for a copied file. 
GitDiffHeader  COPY_TO  Defines the destination path for a copied file. 
GitDiffHeader  DELETED_FILE_MODE  Defines the file mode a source file had before it was deleted. 
GitDiffHeader  DISSIMILARITY_INDEX  Defines the percentage of dissimilarity between a source file and a copied/renamed/moved destination file. 
GitDiffHeader  INDEX  Defines git index data, such as content hashes, for the source and destination files. 
GitDiffHeader  NEW_FILE_MODE  Defines the file mode for a newly-added destination file. 
GitDiffHeader  NEW_MODE  Defines the new mode for a destination file. 
GitDiffHeader  OLD_MODE  Defines the original mode for a source file. 
GitDiffHeader  RENAME_FROM  Defines the source path for a renamed/moved file. 
GitDiffHeader  RENAME_TO  Defines the destination path for a renamed/moved file. 
GitDiffHeader  SIMILARITY_INDEX  Defines the percentage of similarity between a source file and a copied/renamed/moved destination file. 
Public Methods
String getKey()
Retrieves the key identifying this header in an output line.
GitDiffTarget getTarget()
Retrieves the target to which the value of this header applies.
GitDiffHeaderType getType()
Retrieves the type of data provided by the header value.
String getValue(String line)
Removes the leading key from the provided line and returns the value.
static GitDiffHeader valueOf(String name)
final static GitDiffHeader[] values()
[Expand]
Inherited Methods
From class java.lang.Enum
From class java.lang.Object
From interface java.lang.Comparable

Enum Values

public static final GitDiffHeader COPY_FROM

Defines the source path for a copied file.

public static final GitDiffHeader COPY_TO

Defines the destination path for a copied file.

public static final GitDiffHeader DELETED_FILE_MODE

Defines the file mode a source file had before it was deleted.

public static final GitDiffHeader DISSIMILARITY_INDEX

Defines the percentage of dissimilarity between a source file and a copied/renamed/moved destination file.

public static final GitDiffHeader INDEX

Defines git index data, such as content hashes, for the source and destination files.

public static final GitDiffHeader NEW_FILE_MODE

Defines the file mode for a newly-added destination file.

public static final GitDiffHeader NEW_MODE

Defines the new mode for a destination file.

public static final GitDiffHeader OLD_MODE

Defines the original mode for a source file.

public static final GitDiffHeader RENAME_FROM

Defines the source path for a renamed/moved file.

public static final GitDiffHeader RENAME_TO

Defines the destination path for a renamed/moved file.

public static final GitDiffHeader SIMILARITY_INDEX

Defines the percentage of similarity between a source file and a copied/renamed/moved destination file.

Public Methods

public String getKey ()

Retrieves the key identifying this header in an output line.

Note: Header keys may contain one or more spaces, so indexOf-based splitting should not be used.

Returns
  • the header key

public GitDiffTarget getTarget ()

Retrieves the target to which the value of this header applies. The header type will indicate whether a specific target is available.

Returns
  • the header target

public GitDiffHeaderType getType ()

Retrieves the type of data provided by the header value. The type also indicates whether a specific target is related to this header.

Returns
  • the header type

public String getValue (String line)

Removes the leading key from the provided line and returns the value.

Parameters
line the line to split
Returns
  • the value part of the line

public static GitDiffHeader valueOf (String name)

public static final GitDiffHeader[] values ()