Top Description Fields Constructors Methods
org.eclipse.jgit.revwalk

public final Class FooterLine

extends Object
Class Inheritance
Imports
java.nio.charset.Charset, java.util.ArrayList, .Collections, .List, org.eclipse.jgit.util.RawParseUtils

Single line at the end of a message, such as a "Signed-off-by: someone".

These footer lines tend to be used to represent additional information about a commit, like the path it followed through reviewers before finally being accepted into the project's main repository as an immutable commit.

See Also
RevCommit#getFooterLines()

Field Summary

Modifier and TypeField and Description
private final byte[]
private final Charset
private final int
private final int
private final int
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
FooterLine(final byte[] b, final Charset e, final int ks, final int ke, final int vs, final int ve)

Method Summary

Modifier and TypeMethod and Description
public static List<FooterLine>

Returns:

ordered list of footer lines; empty list if no footers found.
fromMessage
(String
the message to extract footers from.
str
)

Extract the footer lines from the given message.

public static List<FooterLine>

Returns:

ordered list of footer lines; empty list if no footers found.
fromMessage
(byte[]
the raw message to extract footers from.
raw
)

Extract the footer lines from the given message.

public String

Returns:

email address appearing in the value of this footer, or null.
getEmailAddress
()

Extract the email address (if present) from the footer.

public int

Returns:

end offset of the footer relative to the original raw message byte buffer
getEndOffset
()

public String

Returns:

key name of this footer; that is the text before the ":" on the line footer's line. The text is decoded according to the commit's specified (or assumed) character encoding.
getKey
()

Get key name of this footer.

public int

Returns:

start offset of the footer relative to the original raw message byte buffer
getStartOffset
()

public String

Returns:

value of this footer; that is the text after the ":" and any leading whitespace has been skipped. May be the empty string if the footer has no value (line ended with ":"). The text is decoded according to the commit's specified (or assumed) character encoding.
getValue
()

Get value of this footer.

public static List<String>

Returns:

values of footers with key of keyName, ordered by their order of appearance. Duplicates may be returned if the same footer appeared more than once. Empty list if no footers appear with the specified key, or there are no footers at all.
getValues
(List<FooterLine>
list of footers to find the values in.
footers
,
String
footer key to find values of, case-insensitive.
keyName
)

Get the values of all footer lines with the given key.

public static List<String>

Returns:

values of footers with key of keyName, ordered by their order of appearance. Duplicates may be returned if the same footer appeared more than once. Empty list if no footers appear with the specified key, or there are no footers at all.
getValues
(List<FooterLine>
list of footers to find the values in.
footers
,
FooterKey
footer key to find values of, case-insensitive.
key
)

Get the values of all footer lines with the given key.

public boolean

Returns:

true if key.getName().equalsIgnorecase(getKey()).
matches
(FooterKey
key to test this line's key name against.
key
)

Whether keys match

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bufferback to summary
private final byte[] buffer
encback to summary
private final Charset enc
keyEndback to summary
private final int keyEnd
keyStartback to summary
private final int keyStart
valEndback to summary
private final int valEnd
valStartback to summary
private final int valStart

Constructor Detail

FooterLineback to summary
pack-priv FooterLine(final byte[] b, final Charset e, final int ks, final int ke, final int vs, final int ve)

Method Detail

fromMessageback to summary
public static List<FooterLine> fromMessage(String str)

Extract the footer lines from the given message.

Parameters
str:String

the message to extract footers from.

Returns:List<FooterLine>

ordered list of footer lines; empty list if no footers found.

Since
6.7
See Also
RevCommit#getFooterLines()
fromMessageback to summary
public static List<FooterLine> fromMessage(byte[] raw)

Extract the footer lines from the given message.

Parameters
raw:byte[]

the raw message to extract footers from.

Returns:List<FooterLine>

ordered list of footer lines; empty list if no footers found.

Since
6.7
See Also
RevCommit#getFooterLines()
getEmailAddressback to summary
public String getEmailAddress()

Extract the email address (if present) from the footer.

If there is an email address looking string inside of angle brackets (e.g. "<a@b>"), the return value is the part extracted from inside the brackets. If no brackets are found, then getValue() is returned if the value contains an '@' sign. Otherwise, null.

Returns:String

email address appearing in the value of this footer, or null.

getEndOffsetback to summary
public int getEndOffset()
Returns:int

end offset of the footer relative to the original raw message byte buffer

Since
6.9
See Also
fromMessage(byte[])
getKeyback to summary
public String getKey()

Get key name of this footer.

Returns:String

key name of this footer; that is the text before the ":" on the line footer's line. The text is decoded according to the commit's specified (or assumed) character encoding.

getStartOffsetback to summary
public int getStartOffset()
Returns:int

start offset of the footer relative to the original raw message byte buffer

Since
6.9
See Also
fromMessage(byte[])
getValueback to summary
public String getValue()

Get value of this footer.

Returns:String

value of this footer; that is the text after the ":" and any leading whitespace has been skipped. May be the empty string if the footer has no value (line ended with ":"). The text is decoded according to the commit's specified (or assumed) character encoding.

getValuesback to summary
public static List<String> getValues(List<FooterLine> footers, String keyName)

Get the values of all footer lines with the given key.

Parameters
footers:List<FooterLine>

list of footers to find the values in.

keyName:String

footer key to find values of, case-insensitive.

Returns:List<String>

values of footers with key of keyName, ordered by their order of appearance. Duplicates may be returned if the same footer appeared more than once. Empty list if no footers appear with the specified key, or there are no footers at all.

Since
6.7
See Also
fromMessage
getValuesback to summary
public static List<String> getValues(List<FooterLine> footers, FooterKey key)

Get the values of all footer lines with the given key.

Parameters
footers:List<FooterLine>

list of footers to find the values in.

key:FooterKey

footer key to find values of, case-insensitive.

Returns:List<String>

values of footers with key of keyName, ordered by their order of appearance. Duplicates may be returned if the same footer appeared more than once. Empty list if no footers appear with the specified key, or there are no footers at all.

Since
6.7
See Also
fromMessage
matchesback to summary
public boolean matches(FooterKey key)

Whether keys match

Parameters
key:FooterKey

key to test this line's key name against.

Returns:boolean

true if key.getName().equalsIgnorecase(getKey()).

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override