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

com.redfin.fuzzy.cases.NullableCase Maven / Gradle / Ivy

package com.redfin.fuzzy.cases;

import com.redfin.fuzzy.Case;
import com.redfin.fuzzy.FuzzyPreconditions;
import com.redfin.fuzzy.Subcase;
import java.util.HashSet;
import java.util.Set;

public class NullableCase implements Case {

	private final Case delegateCase;

	public NullableCase(Case delegateCase) {
		this.delegateCase = FuzzyPreconditions.checkNotNull(delegateCase);
	}

	@Override
	public Set> getSubcases() {
		Set> subcases = new HashSet<>();
		subcases.addAll(delegateCase.getSubcases());
		subcases.add(r -> null);
		return subcases;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy