Created
December 7, 2015 16:20
-
-
Save JLLeitschuh/70d9f8f99025e74a7782 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public synchronized void setValueWithKey(String key) throws IOException, IllegalArgumentException { | |
final List<String> keys = getKeys(); | |
if (keys.contains(key)) { | |
index = keys.indexOf(key); | |
loadImage(paths.get(index)); | |
} else { | |
throw new IllegalArgumentException(key + " was an illegal key"); | |
} | |
} | |
@Override | |
public List<String> getKeys() { | |
return Collections.unmodifiableList(paths.stream().map(path -> Files.getNameWithoutExtension(path)).collect(Collectors.toList())); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment