All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.javers.common.collections.Pair Maven / Gradle / Ivy

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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy