summaryrefslogtreecommitdiff
path: root/plugins/editorconfig/src/org/editorconfig/Utils.java
blob: f64d7be34d85ee6975e260d0f0580afff52ba690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package org.editorconfig;

import org.editorconfig.core.EditorConfig.OutPair;

import java.util.List;

public class Utils {
  public static String configValueForKey(List<OutPair> outPairs, String key) {
    for (OutPair outPair : outPairs) {
      if (outPair.getKey().equals(key)) {
        return outPair.getVal();
      }
    }
    return "";
  }

  public static String invalidConfigMessage(String configValue, String configKey, String filePath) {
    return "\"" + configValue + "\" is not a valid value for " + configKey + " for file " + filePath;
  }

  public static String appliedConfigMessage(String configValue, String configKey, String filePath) {
    return "Applied \"" + configValue + "\" as " + configKey + " for file " + filePath;
  }
}