add a Case block to the expression

@param ca   the object for switch-expression to match
@param func function to apply when matches
@return <code>this</code>
489110
@SuppressWarnings("unchecked")
        public SwitchBlock<T, R> Case(T ca, VFunc0 func) {
                return Case(ca, (def<R>) $(func));
        }
537211
public static AsyncCallback<String> wrapCallback(final JavaScriptObject func) {

        return new AsyncCallback<String>() {

            public void onFailure(Throwable caught) {

                // TODO Auto-generated method stub

            }

            public void onSuccess(String result) {

                callWithString(func, result);
            }

        };
    }
86927
@Nonnull
	public <V extends T> LOiToDblFunctionBuilder<T> aCase(Class<V> argC1, LOiToDblFunction<V> function) {
		PartialCaseWithDblProduct.The pc = partialCaseFactoryMethod((a1, a2) -> (argC1 == null || argC1.isInstance(a1)));

		pc.evaluate(function);
		return self();
	}
848604
@Nonnull
	public <V1 extends T1, V2 extends T2> LObjIntObjPredicateBuilder<T1, T2> aCase(Class<V1> argC1, Class<V2> argC3, LObjIntObjPredicate<V1, V2> function) {
		PartialCaseWithBoolProduct.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)) && (argC3 == null || argC3.isInstance(a2)));

		pc.evaluate(function);
		return self();
	}
1301499
@Nonnull
	public <V extends T> LToLongFunctionBuilder<T> aCase(Class<V> argC, LToLongFunction<V> function) {
		PartialCaseWithLongProduct.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.evaluate(function);
		return self();
	}
19014
@Nonnull
	public <V extends T> LObjIntCharFunctionBuilder<T, R> casesOf(Class<V> argC1, Consumer<LObjIntCharFunctionBuilder<V, R>> pcpConsumer) {
		PartialCaseWithProduct.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)));

		pc.specifySubCases((Consumer) pcpConsumer);
		return self();
	}
1358930
public static <F, T, KeyT extends F, TestT extends F>
  Function<EvalPair<? extends KeyT, ? extends TestT>, EvalPair<T, T>> functionOnBoth(
      final Function<F, T> func) {
    return new Function<EvalPair<? extends KeyT, ? extends TestT>, EvalPair<T, T>>() {
      @Override
      public EvalPair<T, T> apply(final EvalPair<? extends KeyT, ? extends TestT> input) {
        return EvalPair.of(func.apply(input.key()), func.apply(input.test()));
      }

      @Override
      public String toString() {
        return "EvalPair.functionOnBoth(" + func + ")";
      }
    };
  }
858529
private final void switchBlock(Data data, Body body) throws TemplateException {
	while (data.srcCode.isValidIndex()) {
	    comments(data);
	    if (data.srcCode.isCurrent("case ") || data.srcCode.isCurrent("default", ':') || data.srcCode.isCurrent('}')) return;

	    Body prior = data.setParent(body);
	    statement(data, body, CTX_SWITCH);
	    data.setParent(prior);
	}
    }
209800
public void setCases(List<SwitchCase> cases) {
        if (cases == null) {
            this.cases = null;
        } else {
            if (this.cases != null)
                this.cases.clear();
            for (SwitchCase sc : cases)
                addCase(sc);
        }
    }
836329
@Nonnull
	public <V extends T> LObjBiIntPredicateBuilder<T> casesOf(Class<V> argC1, Consumer<LObjBiIntPredicateBuilder<V>> pcpConsumer) {
		PartialCaseWithBoolProduct.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)));

		pc.specifySubCases((Consumer) pcpConsumer);
		return self();
	}
1148139
@Nonnull
	public <V extends T> LToSrtFunctionBuilder<T> aCase(Class<V> argC, LToSrtFunction<V> function) {
		PartialCaseWithSrtProduct.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.evaluate(function);
		return self();
	}
696017
@Nonnull
	public <V1 extends T1, V2 extends T2> LBiObjFltConsumerBuilder<T1, T2> aCase(Class<V1> argC1, Class<V2> argC2, LBiObjFltConsumer<V1, V2> function) {
		PartialCase.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)) && (argC2 == null || argC2.isInstance(a2)));

		pc.evaluate(function);
		return self();
	}
815555
function (func) {
		if (!(this instanceof Deferred)) {
			return new Deferred();
		}
		this._doneFuncs = [];
		this._failFuncs = [];
		this._resultArgs = null;
		this._status = '';
		// Check for option `function` -- call it with this as context and as first
		// parameter, as specified in jQuery API.
		if (func) {
			func.call(this, this);
		}
	}
1284805
public static boolean isCase(Object switchValue, Object caseExpression) throws Throwable {
        if (caseExpression == null) {
            return switchValue == null;
        }
        return DefaultTypeTransformation.castToBoolean(invokeMethodN(caseExpression.getClass(), caseExpression, "isCase", new Object[]{switchValue}));
    }
1041596
@Beta
    public static <T, R> Function<T, R> sf(final Object mutex, final Function<T, R> function) {
        N.checkArgNotNull(mutex, "mutex");
        N.checkArgNotNull(function, "function");

        return new Function<T, R>() {
            @Override
            public R apply(T t) {
                synchronized (mutex) {
                    return function.apply(t);
                }
            }
        };
    }
1324302
@Nonnull
	public <V extends T> LObjBoolPredicateBuilder<T> aCase(Class<V> argC1, LObjBoolPredicate<V> function) {
		PartialCaseWithBoolProduct.The pc = partialCaseFactoryMethod((a1, a2) -> (argC1 == null || argC1.isInstance(a1)));

		pc.evaluate(function);
		return self();
	}
1022429
final public function each($func)
    {
        foreach ($this->elements as $inx => $val)
        {
            call_user_func($func,$inx,$val);
        }
        return $this;
    }