public enum GitDiffHeader extends Enum<GitDiffHeader>
git diff output. These will appear after the diff --git banner
and before any hunks.| Enum Constant and Description |
|---|
COPY_FROM
Defines the source path for a copied file.
|
COPY_TO
Defines the destination path for a copied file.
|
DELETED_FILE_MODE
Defines the file mode a source file had before it was deleted.
|
DISSIMILARITY_INDEX
Defines the percentage of dissimilarity between a source file and a copied/renamed/moved destination file.
|
INDEX
Defines git index data, such as content hashes, for the source and destination files.
|
NEW_FILE_MODE
Defines the file mode for a newly-added destination file.
|
NEW_MODE
Defines the new mode for a destination file.
|
OLD_MODE
Defines the original mode for a source file.
|
RENAME_FROM
Defines the source path for a renamed/moved file.
|
RENAME_TO
Defines the destination path for a renamed/moved file.
|
SIMILARITY_INDEX
Defines the percentage of similarity between a source file and a copied/renamed/moved destination file.
|
| Modifier and Type | Method and Description |
|---|---|
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)
Returns the enum constant of this type with the specified name.
|
static GitDiffHeader[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final GitDiffHeader COPY_FROM
public static final GitDiffHeader COPY_TO
public static final GitDiffHeader DELETED_FILE_MODE
public static final GitDiffHeader DISSIMILARITY_INDEX
public static final GitDiffHeader INDEX
public static final GitDiffHeader NEW_FILE_MODE
public static final GitDiffHeader NEW_MODE
public static final GitDiffHeader OLD_MODE
public static final GitDiffHeader RENAME_FROM
public static final GitDiffHeader RENAME_TO
public static final GitDiffHeader SIMILARITY_INDEX
public static GitDiffHeader[] values()
for (GitDiffHeader c : GitDiffHeader.values()) System.out.println(c);
public static GitDiffHeader valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getKey()
Note: Header keys may contain one or more spaces, so indexOf-based splitting should not be used.
public GitDiffTarget getTarget()
header type will indicate
whether a specific target is available.public GitDiffHeaderType getType()
header value. The type also indicates
whether a specific target is related to this header.Copyright © 2019 Atlassian. All rights reserved.