Class FooterLine


  • public final class FooterLine
    extends java.lang.Object
    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

      Fields 
      Modifier and Type Field Description
      private byte[] buffer  
      private java.nio.charset.Charset enc  
      private int keyEnd  
      private int keyStart  
      private int valEnd  
      private int valStart  
    • Constructor Summary

      Constructors 
      Constructor Description
      FooterLine​(byte[] b, java.nio.charset.Charset e, int ks, int ke, int vs, int ve)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getEmailAddress()
      Extract the email address (if present) from the footer.
      java.lang.String getKey()
      Get key name of this footer.
      java.lang.String getValue()
      Get value of this footer.
      boolean matches​(FooterKey key)
      Whether keys match
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • buffer

        private final byte[] buffer
      • enc

        private final java.nio.charset.Charset enc
      • keyStart

        private final int keyStart
      • keyEnd

        private final int keyEnd
      • valStart

        private final int valStart
      • valEnd

        private final int valEnd
    • Constructor Detail

      • FooterLine

        FooterLine​(byte[] b,
                   java.nio.charset.Charset e,
                   int ks,
                   int ke,
                   int vs,
                   int ve)
    • Method Detail

      • matches

        public boolean matches​(FooterKey key)
        Whether keys match
        Parameters:
        key - key to test this line's key name against.
        Returns:
        true if key.getName().equalsIgnorecase(getKey()).
      • getKey

        public java.lang.String getKey()
        Get key name of this footer.
        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.
      • getValue

        public java.lang.String getValue()
        Get value of this footer.
        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.
      • getEmailAddress

        public java.lang.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:
        email address appearing in the value of this footer, or null.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object