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

de.tsl2.nano.modelkit.Selectable Maven / Gradle / Ivy

Go to download

TSL2 Framework to provide and use a structure of elements referenced by unique names - to declare a kit of logic in a json/yaml/xml text file

The newest version!
package de.tsl2.nano.modelkit;

import java.util.List;
import java.util.stream.Collectors;

import de.tsl2.nano.modelkit.impl.Fact;

@SuppressWarnings("unchecked")
public interface Selectable extends Configured {
    boolean canSelect(T current);

    default boolean canSelect(String factName, Object current) {
        return get(factName, Fact.class).ask(current);
    }

    default List from(List list) {
        return list.stream().filter(t -> canSelect(t)).collect(Collectors.toList());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy