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

org.archifacts.integration.c4.model.ModelItemComputationRule Maven / Gradle / Ivy

The newest version!
package org.archifacts.integration.c4.model;

import java.util.Set;
import java.util.function.Predicate;

import org.archifacts.core.model.Archifact;

import com.structurizr.model.ModelItem;

public final class ModelItemComputationRule implements Predicate, ComputationFunction {

	private final Predicate predicate;
	private final ComputationFunction computation;

	ModelItemComputationRule(final Predicate predicate, final ComputationFunction computation) {
		this.predicate = predicate;
		this.computation = computation;
	}

	@Override
	public boolean test(final ARCHIFACT archifact) {
		return predicate.test(archifact);
	}

	@Override
	public Set apply(final ARCHIFACT archifact, final C4ModelLookup lookup) {
		return computation.apply(archifact, lookup);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy