Example usage for org.eclipse.jgit.revwalk FooterLine getValue

List of usage examples for org.eclipse.jgit.revwalk FooterLine getValue

Introduction

In this page you can find the example usage for org.eclipse.jgit.revwalk FooterLine getValue.

Prototype

public String getValue() 

Source Link

Document

Get value of this footer.

Usage

From source file:com.google.gerrit.server.config.TrackingFooters.java

License:Apache License

public Multimap<String, String> extract(List<FooterLine> lines) {
    Multimap<String, String> r = ArrayListMultimap.create();
    for (FooterLine footer : lines) {
        for (TrackingFooter config : trackingFooters) {
            if (footer.matches(config.footerKey())) {
                Matcher m = config.match().matcher(footer.getValue());
                while (m.find()) {
                    String id = m.groupCount() > 0 ? m.group(1) : m.group();
                    if (!id.isEmpty()) {
                        r.put(config.system(), id);
                    }/*from  w ww  . j a  va  2s . c o  m*/
                }
            }
        }
    }
    return r;
}

From source file:com.google.gerrit.server.git.MergeUtil.java

License:Apache License

private static boolean contains(List<FooterLine> footers, FooterKey key, String val) {
    for (final FooterLine line : footers) {
        if (line.matches(key) && val.equals(line.getValue())) {
            return true;
        }/*from   ww w  .  jav  a2 s  .c o  m*/
    }
    return false;
}

From source file:com.google.gerrit.server.mail.MailUtil.java

License:Apache License

public static MailRecipients getRecipientsFromFooters(final AccountResolver accountResolver, final PatchSet ps,
        final List<FooterLine> footerLines) throws OrmException {
    final MailRecipients recipients = new MailRecipients();
    if (!ps.isDraft()) {
        for (final FooterLine footerLine : footerLines) {
            try {
                if (isReviewer(footerLine)) {
                    recipients.reviewers.add(toAccountId(accountResolver, footerLine.getValue().trim()));
                } else if (footerLine.matches(FooterKey.CC)) {
                    recipients.cc.add(toAccountId(accountResolver, footerLine.getValue().trim()));
                }/*w w  w .ja v  a2s.  c  o  m*/
            } catch (NoSuchAccountException e) {
                continue;
            }
        }
    }
    return recipients;
}

From source file:com.google.gerrit.server.notedb.ChangeNotesCommit.java

License:Apache License

public List<String> getFooterLineValues(FooterKey key) {
    if (footerLines == null) {
        List<FooterLine> src = getFooterLines();
        footerLines = ArrayListMultimap.create(src.size(), 1);
        for (FooterLine fl : src) {
            footerLines.put(fl.getKey().toLowerCase(), fl.getValue());
        }//from  w  w w.  j  av  a2 s  .c om
    }
    return footerLines.get(key.getName().toLowerCase());
}