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

com.redfin.fuzzy.pairwise.Param Maven / Gradle / Ivy

package com.redfin.fuzzy.pairwise;

import com.redfin.fuzzy.FuzzyPreconditions;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/*package*/ class Param {

	/*package*/ final int id;
	/*package*/ final List values;

	public Param(int id, List values) {
		FuzzyPreconditions.checkNotNullAndContainsNoNulls(values);

		this.id = id;

		int[] paramId = new int[] { 0 };
		this.values = Collections.unmodifiableList(values.stream()
			.map(p -> new ParamValue(this, paramId[0]++, p))
			.collect(Collectors.toList())
		);
	}

}