com.nls.util.TupleList Maven / Gradle / Ivy
package com.nls.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class TupleList extends ArrayList> {
public TupleList(Collection extends Tuple> collection) {
super(collection);
}
public TupleList(Map map) {
this(Tuple.fromMap(map));
}
public TupleList reverseTuples() {
return new TupleList(this.stream().map(Tuple::reverse).collect(Collectors.toList()));
}
public Map toMap() {
return Tuple.toMap(this);
}
public Map> toGroupedMap() {
return Tuple.toGroupedMap(this);
}
}