class BavetScoringUniConstraintStream<Solution_, A>
        extends BavetAbstractUniConstraintStream<Solution_, A>
        implements BavetScoringConstraintStream<Solution_> {

    private final BavetAbstractUniConstraintStream<Solution_, A> parent;
    private final boolean noMatchWeigher;
    private final ToIntFunction<A> intMatchWeigher;
    private final ToLongFunction<A> longMatchWeigher;
    private final Function<A, BigDecimal> bigDecimalMatchWeigher;
    private BavetConstraint<Solution_> constraint;

    public BavetScoringUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory,
            BavetAbstractUniConstraintStream<Solution_, A> parent,
            ToIntFunction<A> intMatchWeigher) {
        this(constraintFactory, parent, false, intMatchWeigher, null, null);
        if (intMatchWeigher == null) {
            throw new IllegalArgumentException("The matchWeigher (null) cannot be null.");
        }
    }

    public BavetScoringUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory,
            BavetAbstractUniConstraintStream<Solution_, A> parent,
            ToLongFunction<A> longMatchWeigher) {
        this(constraintFactory, parent, false, null, longMatchWeigher, null);
        if (longMatchWeigher == null) {
            throw new IllegalArgumentException("The matchWeigher (null) cannot be null.");
        }
    }

    public BavetScoringUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory,
            BavetAbstractUniConstraintStream<Solution_, A> parent,
            Function<A, BigDecimal> bigDecimalMatchWeigher) {
        this(constraintFactory, parent, false, null, null, bigDecimalMatchWeigher);
        if (bigDecimalMatchWeigher == null) {
            throw new IllegalArgumentException("The matchWeigher (null) cannot be null.");
        }
    }

    private BavetScoringUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory,
            BavetAbstractUniConstraintStream<Solution_, A> parent,
            boolean noMatchWeigher, ToIntFunction<A> intMatchWeigher, ToLongFunction<A> longMatchWeigher,
            Function<A, BigDecimal> bigDecimalMatchWeigher) {
        super(constraintFactory, parent.getRetrievalSemantics());
        this.parent = parent;
        this.noMatchWeigher = noMatchWeigher;
        this.intMatchWeigher = intMatchWeigher;
        this.longMatchWeigher = longMatchWeigher;
        this.bigDecimalMatchWeigher = bigDecimalMatchWeigher;
    }

    @Override
    public void setConstraint(BavetConstraint<Solution_> constraint) {
        this.constraint = constraint;
    }

    @Override
    public boolean guaranteesDistinct() {
        return parent.guaranteesDistinct();
    }

    // ************************************************************************
    // Node creation
    // ************************************************************************

    @Override
    public void collectActiveConstraintStreams(Set<BavetAbstractConstraintStream<Solution_>> constraintStreamSet) {
        parent.collectActiveConstraintStreams(constraintStreamSet);
        constraintStreamSet.add(this);
    }

    @Override
    public BavetAbstractConstraintStream<Solution_> getTupleSource() {
        return parent.getTupleSource();
    }

    @Override
    public <Score_ extends Score<Score_>> void buildNode(NodeBuildHelper<Score_> buildHelper) {<FILL_FUNCTION_BODY>}

    // ************************************************************************
    // Equality for node sharing
    // ************************************************************************

    // No node sharing

    @Override
    public String toString() {
        return "Scoring(" + constraint.getConstraintName() + ")";
    }

    // ************************************************************************
    // Getters/setters
    // ************************************************************************

}

        if (!childStreamList.isEmpty()) {
            throw new IllegalStateException("Impossible state: the stream (" + this
                    + ") has an non-empty childStreamList (" + childStreamList + ") but it's an endpoint.");
        }
        Score_ constraintWeight = buildHelper.getConstraintWeight(constraint);
        WeightedScoreImpacter<Score_, ?> weightedScoreImpacter =
                buildHelper.getScoreInliner().buildWeightedScoreImpacter(constraint, constraintWeight);
        boolean constraintMatchEnabled = buildHelper.getScoreInliner().isConstraintMatchEnabled();
        Function<A, UndoScoreImpacter> scoreImpacter;
        if (intMatchWeigher != null) {
            if (constraintMatchEnabled) {
                scoreImpacter = a -> {
                    int matchWeight = intMatchWeigher.applyAsInt(a);
                    constraint.assertCorrectImpact(matchWeight);
                    JustificationsSupplier justificationsSupplier =
                            of(constraint, constraint.getJustificationMapping(), constraint.getIndictedObjectsMapping(), a);
                    return weightedScoreImpacter.impactScore(matchWeight, justificationsSupplier);
                };
            } else {
                scoreImpacter = a -> {
                    int matchWeight = intMatchWeigher.applyAsInt(a);
                    constraint.assertCorrectImpact(matchWeight);
                    return weightedScoreImpacter.impactScore(matchWeight, null);
                };
            }
        } else if (longMatchWeigher != null) {
            if (constraintMatchEnabled) {
                scoreImpacter = a -> {
                    long matchWeight = longMatchWeigher.applyAsLong(a);
                    constraint.assertCorrectImpact(matchWeight);
                    JustificationsSupplier justificationsSupplier =
                            of(constraint, constraint.getJustificationMapping(), constraint.getIndictedObjectsMapping(), a);
                    return weightedScoreImpacter.impactScore(matchWeight, justificationsSupplier);
                };
            } else {
                scoreImpacter = a -> {
                    long matchWeight = longMatchWeigher.applyAsLong(a);
                    constraint.assertCorrectImpact(matchWeight);
                    return weightedScoreImpacter.impactScore(matchWeight, null);
                };
            }
        } else if (bigDecimalMatchWeigher != null) {
            if (constraintMatchEnabled) {
                scoreImpacter = a -> {
                    BigDecimal matchWeight = bigDecimalMatchWeigher.apply(a);
                    constraint.assertCorrectImpact(matchWeight);
                    JustificationsSupplier justificationsSupplier =
                            of(constraint, constraint.getJustificationMapping(), constraint.getIndictedObjectsMapping(), a);
                    return weightedScoreImpacter.impactScore(matchWeight, justificationsSupplier);
                };
            } else {
                scoreImpacter = a -> {
                    BigDecimal matchWeight = bigDecimalMatchWeigher.apply(a);
                    constraint.assertCorrectImpact(matchWeight);
                    return weightedScoreImpacter.impactScore(matchWeight, null);
                };
            }
        } else if (noMatchWeigher) {
            if (constraintMatchEnabled) {
                scoreImpacter = a -> {
                    JustificationsSupplier justificationsSupplier =
                            of(constraint, constraint.getJustificationMapping(), constraint.getIndictedObjectsMapping(), a);
                    return weightedScoreImpacter.impactScore(1, justificationsSupplier);
                };
            } else {
                scoreImpacter = a -> weightedScoreImpacter.impactScore(1, null);
            }
        } else {
            throw new IllegalStateException("Impossible state: neither of the supported match weighers provided.");
        }
        UniScorer<A> scorer = new UniScorer<>(constraint.getConstraintPackage(), constraint.getConstraintName(),
                constraintWeight, scoreImpacter, buildHelper.reserveTupleStoreIndex(parent.getTupleSource()));
        buildHelper.putInsertUpdateRetract(this, scorer);
    
<methods>public void <init>(BavetConstraintFactory<Solution_>, org.optaplanner.constraint.streams.common.RetrievalSemantics) ,public BavetAbstractUniConstraintStream<Solution_,A> filter(Predicate<A>) ,public UniConstraintStream<ResultA_> flattenLast(Function<A,Iterable<ResultA_>>) ,public List<BavetAbstractUniConstraintStream<Solution_,A>> getChildStreamList() ,public UniConstraintStream<Result_> groupBy(UniConstraintCollector<A,ResultContainer_,Result_>) ,public BiConstraintStream<ResultA_,ResultB_> groupBy(UniConstraintCollector<A,ResultContainerA_,ResultA_>, UniConstraintCollector<A,ResultContainerB_,ResultB_>) ,public TriConstraintStream<ResultA_,ResultB_,ResultC_> groupBy(UniConstraintCollector<A,ResultContainerA_,ResultA_>, UniConstraintCollector<A,ResultContainerB_,ResultB_>, UniConstraintCollector<A,ResultContainerC_,ResultC_>) ,public QuadConstraintStream<ResultA_,ResultB_,ResultC_,ResultD_> groupBy(UniConstraintCollector<A,ResultContainerA_,ResultA_>, UniConstraintCollector<A,ResultContainerB_,ResultB_>, UniConstraintCollector<A,ResultContainerC_,ResultC_>, UniConstraintCollector<A,ResultContainerD_,ResultD_>) ,public UniConstraintStream<GroupKey_> groupBy(Function<A,GroupKey_>) ,public TriConstraintStream<GroupKey_,ResultB_,ResultC_> groupBy(Function<A,GroupKey_>, UniConstraintCollector<A,ResultContainerB_,ResultB_>, UniConstraintCollector<A,ResultContainerC_,ResultC_>) ,public QuadConstraintStream<GroupKey_,ResultB_,ResultC_,ResultD_> groupBy(Function<A,GroupKey_>, UniConstraintCollector<A,ResultContainerB_,ResultB_>, UniConstraintCollector<A,ResultContainerC_,ResultC_>, UniConstraintCollector<A,ResultContainerD_,ResultD_>) ,public BiConstraintStream<GroupKey_,Result_> groupBy(Function<A,GroupKey_>, UniConstraintCollector<A,ResultContainer_,Result_>) ,public BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(Function<A,GroupKeyA_>, Function<A,GroupKeyB_>) ,public TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(Function<A,GroupKeyA_>, Function<A,GroupKeyB_>, UniConstraintCollector<A,ResultContainer_,Result_>) ,public QuadConstraintStream<GroupKeyA_,GroupKeyB_,ResultC_,ResultD_> groupBy(Function<A,GroupKeyA_>, Function<A,GroupKeyB_>, UniConstraintCollector<A,ResultContainerC_,ResultC_>, UniConstraintCollector<A,ResultContainerD_,ResultD_>) ,public TriConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_> groupBy(Function<A,GroupKeyA_>, Function<A,GroupKeyB_>, Function<A,GroupKeyC_>) ,public QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultD_> groupBy(Function<A,GroupKeyA_>, Function<A,GroupKeyB_>, Function<A,GroupKeyC_>, UniConstraintCollector<A,ResultContainerD_,ResultD_>) ,public QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_> groupBy(Function<A,GroupKeyA_>, Function<A,GroupKeyB_>, Function<A,GroupKeyC_>, Function<A,GroupKeyD_>) ,public final transient UniConstraintStream<A> ifExists(Class<B>, BiJoiner<A,B>[]) ,public final transient UniConstraintStream<A> ifExists(UniConstraintStream<B>, BiJoiner<A,B>[]) ,public final transient UniConstraintStream<A> ifExistsIncludingNullVars(Class<B>, BiJoiner<A,B>[]) ,public final transient UniConstraintStream<A> ifNotExists(Class<B>, BiJoiner<A,B>[]) ,public final transient UniConstraintStream<A> ifNotExists(UniConstraintStream<B>, BiJoiner<A,B>[]) ,public final transient UniConstraintStream<A> ifNotExistsIncludingNullVars(Class<B>, BiJoiner<A,B>[]) ,public UniConstraintBuilder<A,Score_> innerImpact(Score_, ToIntFunction<A>, org.optaplanner.constraint.streams.common.ScoreImpactType) ,public UniConstraintBuilder<A,Score_> innerImpact(Score_, ToLongFunction<A>, org.optaplanner.constraint.streams.common.ScoreImpactType) ,public UniConstraintBuilder<A,Score_> innerImpact(Score_, Function<A,java.math.BigDecimal>, org.optaplanner.constraint.streams.common.ScoreImpactType) ,public final transient BiConstraintStream<A,B> join(UniConstraintStream<B>, BiJoiner<A,B>[]) ,public final BiConstraintStream<A,B> join(UniConstraintStream<B>, BiJoinerComber<A,B>) ,public UniConstraintStream<ResultA_> map(Function<A,ResultA_>) ,public Stream_ shareAndAddChild(Stream_) <variables>protected final List<BavetAbstractUniConstraintStream<Solution_,A>> childStreamList