/**
 * 
 */
package com.github.phantomthief.failover.impl;

import java.util.Collection;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;

/**
 * @author w.vela
 */
public class GenericWeightFailoverBuilder<E> {

    private final WeightFailoverBuilder<Object> builder;

    GenericWeightFailoverBuilder(WeightFailoverBuilder<Object> builder) {
        this.builder = builder;
    }

    public GenericWeightFailoverBuilder<E> failReduce(int weight) {
        builder.failReduce(weight);
        return this;
    }

    public GenericWeightFailoverBuilder<E> successIncrease(int weight) {
        builder.successIncrease(weight);
        return this;
    }

    public GenericWeightFailoverBuilder<E> recoveiedInit(int weight) {
        builder.recoveiedInit(weight);
        return this;
    }

    public GenericWeightFailoverBuilder<E> checkDuration(long time, TimeUnit unit) {
        builder.checkDuration(time, unit);
        return this;
    }

    public GenericWeightFailoverBuilder<E> checker(Predicate<? super E> failChecker) {
        builder.checker(failChecker);
        return this;
    }

    public GenericWeightFailoverBuilder<E> build(Collection<? extends E> original) {
        builder.build(original);
        return this;
    }

    public GenericWeightFailoverBuilder<E> build(Collection<? extends E> original, int initWeight) {
        builder.build(original, initWeight);
        return this;
    }

    public WeightFailover<E> build(Map<? extends E, Integer> original) {
        return builder.build(original);
    }

}

@@ -1149,39 +1149,32 @@
   %7D%0A%0A    public 
-Generic
 WeightFailoverBu
@@ -1163,39 +1163,32 @@
 c WeightFailover
-Builder
 %3CE%3E build(Collec
@@ -1217,32 +1217,39 @@
 inal) %7B%0A        
+return 
 builder.build(or
@@ -1257,37 +1257,16 @@
 ginal);%0A
-        return this;%0A
     %7D%0A%0A 
@@ -1267,39 +1267,32 @@
   %7D%0A%0A    public 
-Generic
 WeightFailoverBu
@@ -1285,31 +1285,24 @@
 ightFailover
-Builder
 %3CE%3E build(Co
@@ -1351,32 +1351,39 @@
 ight) %7B%0A        
+return 
 builder.build(or
@@ -1403,37 +1403,16 @@
 eight);%0A
-        return this;%0A
     %7D%0A%0A 

fix generic build method.