Interface ConstraintMatchSupplier<Score_ extends Score<Score_>>
-
- All Superinterfaces:
BiFunction<Constraint,Score_,ConstraintMatch<Score_>>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ConstraintMatchSupplier<Score_ extends Score<Score_>> extends BiFunction<Constraint,Score_,ConstraintMatch<Score_>>
Allows creatingConstraintMatchinstances lazily if and only if they are required by the end user.Lazy behavior is important for constraint matching performance. In order to create
ConstraintMatch, an entireConstraintJustificationobject needs to be created, along with the collection of indicted objects. Creating these structures every time a constraint is matched would be wasteful, as the same constraint match can be undone almost immediately, resulting in a lot of pointless garbage. Therefore,ConstraintMatch(along with all of its supporting data structures) is only created when actually needed, and that is during score explanation. Until that point, this thin wrapper serves as a placeholder which understands what to create when needed.
-
-
Method Summary
Static Methods Modifier and Type Method Description static <Score_ extends Score<Score_>>
ConstraintMatchSupplier<Score_>empty()static <A,B,C,D,Score_ extends Score<Score_>>
ConstraintMatchSupplier<Score_>of(PentaFunction<A,B,C,D,Score_,ConstraintJustification> justificationMapping, QuadFunction<A,B,C,D,Collection<Object>> indictedObjectsMapping, A a, B b, C c, D d)static <A,B,C,Score_ extends Score<Score_>>
ConstraintMatchSupplier<Score_>of(QuadFunction<A,B,C,Score_,ConstraintJustification> justificationMapping, TriFunction<A,B,C,Collection<Object>> indictedObjectsMapping, A a, B b, C c)static <A,B,Score_ extends Score<Score_>>
ConstraintMatchSupplier<Score_>of(TriFunction<A,B,Score_,ConstraintJustification> justificationMapping, BiFunction<A,B,Collection<Object>> indictedObjectsMapping, A a, B b)static <A,Score_ extends Score<Score_>>
ConstraintMatchSupplier<Score_>of(BiFunction<A,Score<?>,ConstraintJustification> justificationMapping, Function<A,Collection<Object>> indictedObjectsMapping, A a)-
Methods inherited from interface java.util.function.BiFunction
andThen, apply
-
-
-
-
Method Detail
-
empty
static <Score_ extends Score<Score_>> ConstraintMatchSupplier<Score_> empty()
-
of
static <A,Score_ extends Score<Score_>> ConstraintMatchSupplier<Score_> of(BiFunction<A,Score<?>,ConstraintJustification> justificationMapping, Function<A,Collection<Object>> indictedObjectsMapping, A a)
-
of
static <A,B,Score_ extends Score<Score_>> ConstraintMatchSupplier<Score_> of(TriFunction<A,B,Score_,ConstraintJustification> justificationMapping, BiFunction<A,B,Collection<Object>> indictedObjectsMapping, A a, B b)
-
of
static <A,B,C,Score_ extends Score<Score_>> ConstraintMatchSupplier<Score_> of(QuadFunction<A,B,C,Score_,ConstraintJustification> justificationMapping, TriFunction<A,B,C,Collection<Object>> indictedObjectsMapping, A a, B b, C c)
-
of
static <A,B,C,D,Score_ extends Score<Score_>> ConstraintMatchSupplier<Score_> of(PentaFunction<A,B,C,D,Score_,ConstraintJustification> justificationMapping, QuadFunction<A,B,C,D,Collection<Object>> indictedObjectsMapping, A a, B b, C c, D d)
-
-