org.javers.common.collections.Pair Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javers-core Show documentation
Show all versions of javers-core Show documentation
JaVers - object auditing and diff framework for Java
package org.javers.common.collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* @author bartosz.walacik
*/
public class Pair {
private final L left;
private final R right;
public Pair(L left, R right) {
this.left = left;
this.right = right;
}
public L left() {
return left;
}
public R right() {
return right;
}
public static Set collectRightAsSet(List> pairList) {
Set result = new HashSet<>();
for (Pair pair : pairList) {
result.add(pair.right);
}
return result;
}
}