use of com.google.common.base.Splitter in project closure-compiler by google.
the class RefasterJs method getExterns.
private List<String> getExterns() throws IOException {
Set<String> patterns = new HashSet<>();
// The args4j library can't handle multiple files provided within the same flag option,
// like --externs=file1.js,file2.js so handle that here.
Splitter commaSplitter = Splitter.on(',');
for (String extern : externs) {
patterns.addAll(commaSplitter.splitToList(extern));
}
return CommandLineRunner.findJsFiles(patterns);
}
use of com.google.common.base.Splitter in project runelite by runelite.
the class GroundItemsPlugin method reset.
private void reset() {
Splitter COMMA_SPLITTER = Splitter.on(Pattern.compile("\\s*,\\s*"));
// gets the hidden items from the text box in the config
hiddenItemList = COMMA_SPLITTER.splitToList(config.getHiddenItems().trim());
// gets the highlighted items from the text box in the config
highlightedItemsList = COMMA_SPLITTER.splitToList(config.getHighlightItems().trim());
highlightedItems = CacheBuilder.newBuilder().maximumSize(512L).expireAfterAccess(10, TimeUnit.MINUTES).build(new WildcardMatchLoader(highlightedItemsList));
hiddenItems = CacheBuilder.newBuilder().maximumSize(512L).expireAfterAccess(10, TimeUnit.MINUTES).build(new WildcardMatchLoader(hiddenItemList));
dirty = true;
}
use of com.google.common.base.Splitter in project vespa by vespa-engine.
the class CompoundNameTestCase method testAsList.
@Test
public final void testAsList() {
List<String> l = cn.asList();
Splitter peoplesFront = Splitter.on('.');
Iterable<String> answer = peoplesFront.split(NAME);
Iterator<String> expected = answer.iterator();
for (int i = 0; i < l.size(); ++i) {
assertEquals(expected.next(), l.get(i));
}
assertFalse(expected.hasNext());
}
use of com.google.common.base.Splitter in project vespa by vespa-engine.
the class CompoundNameTestCase method testSize.
@Test
public final void testSize() {
Splitter s = Splitter.on('.');
Iterable<String> i = s.split(NAME);
int n = 0;
for (@SuppressWarnings("unused") String x : i) {
++n;
}
assertEquals(n, cn.size());
}
use of com.google.common.base.Splitter in project vespa by vespa-engine.
the class TemplatingTestCase method testGetCurrentResultURL.
@Test
public final void testGetCurrentResultURL() {
String previous = result.getTemplating().getCurrentResultURL();
Set<String> expectedParameters = new HashSet<>(Arrays.asList(new String[] { "hits=5", "query=a", "presentation.format=nalle", "offset=1" }));
Set<String> actualParameters = new HashSet<>();
Splitter s = Splitter.on("&");
for (String parameter : s.split(previous.substring(previous.indexOf('?') + 1))) {
actualParameters.add(parameter);
}
assertEquals(expectedParameters, actualParameters);
}
Aggregations