Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package telnet;
- import java.util.AbstractMap.SimpleEntry;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Map.Entry;
- class Entries {
- List<Entry> entries;
- void set(List<Entry> stringEntries) {
- entries = new ArrayList<>();
- String key = null, stringVal = null;
- int intVal = 0;
- for (Entry e : stringEntries) {
- stringVal = (String) e.getValue();
- intVal = Integer.parseInt(stringVal);
- Entry<String, Integer> entry = new SimpleEntry<>(key, intVal);
- entries.add(e);
- }
- System.out.println("monitor entries to follow");
- for (Entry e : entries) {
- System.out.println(e.getKey() + e.getValue().toString());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment