Example usage for org.eclipse.jgit.attributes Attribute getValue

List of usage examples for org.eclipse.jgit.attributes Attribute getValue

Introduction

In this page you can find the example usage for org.eclipse.jgit.attributes Attribute getValue.

Prototype

public String getValue() 

Source Link

Document

Get value

Usage

From source file:com.diffplug.gradle.spotless.GitAttributesLineEndingPolicy.java

License:Apache License

/** Parses an attribute value from a list of rules, returning null if there is no match for the given key. */
static String findAttributeInRules(String subpath, boolean isFolder, String key, List<AttributesRule> rules) {
    String value = null;/*  w ww .j av  a2s  . c o m*/
    // later rules override earlier ones
    for (AttributesRule rule : rules) {
        if (rule.isMatch(subpath, isFolder)) {
            for (Attribute attribute : rule.getAttributes()) {
                if (attribute.getKey().equals(key)) {
                    value = attribute.getValue();
                }
            }
        }
    }
    return value;
}

From source file:com.diffplug.spotless.extra.GitAttributesLineEndings.java

License:Apache License

/** Parses an attribute value from a list of rules, returning null if there is no match for the given key. */
private static @Nullable String findAttributeInRules(String subpath, boolean isFolder, String key,
        List<AttributesRule> rules) {
    String value = null;/*from w w  w.j a  v  a 2 s.  com*/
    // later rules override earlier ones
    for (AttributesRule rule : rules) {
        if (rule.isMatch(subpath, isFolder)) {
            for (Attribute attribute : rule.getAttributes()) {
                if (attribute.getKey().equals(key)) {
                    value = attribute.getValue();
                }
            }
        }
    }
    return value;
}