@Override public R apply(T1 t1, T2 t2) throws Exception { if (t1 == null) { throw new NullPointerException("t1 is null, tag = " + tag); } if (t2 == null) { throw new NullPointerException("t2 is null, tag = " + tag); } R v; try { v = actual.apply(t1, t2); } catch (Throwable ex) { throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex)); } if (v == null) { throw new NullPointerException("The BiFunction returned null, tag = " + tag); } return v; } }
@Test public void f1Tag() throws Exception { boolean enabled = FunctionTagging.isEnabled(); try { FunctionTagging.disable(); Function<Integer, Integer> f = FunctionTagging.tagFunction(Functions.<Integer>identity(), "Custom tag"); FunctionTagging.enable(); f = FunctionTagging.tagFunction(Functions.<Integer>identity(), "Custom tag"); f = FunctionTagging.tagFunction(new Function<Integer, Integer>() { @Override public Integer apply(Integer a) throws Exception { f = FunctionTagging.tagFunction(new Function<Integer, Integer>() { @Override public Integer apply(Integer a) throws Exception { FunctionTagging.disable();
@Test public void f6Tag() throws Exception { boolean enabled = FunctionTagging.isEnabled(); try { Function6<Integer, Integer, Integer, Integer, Integer, Integer, Integer> f; int k = 6; FunctionTagging.disable(); f = FunctionTagging.tagFunction6( new FunctionTaggingComposite(i, false, false), "Custom tag"); FunctionTagging.enable(); f = FunctionTagging.tagFunction6( new FunctionTaggingComposite(i, false, false), "Custom tag"); f = FunctionTagging.tagFunction6( new FunctionTaggingComposite(0, true, false), "Custom tag"); f = FunctionTagging.tagFunction6( new FunctionTaggingComposite(0, false, true), "Custom tag"); FunctionTagging.disable();
@Test public void f2Tag() throws Exception { boolean enabled = FunctionTagging.isEnabled(); try { FunctionTagging.disable(); BiFunction<Integer, Integer, Integer> f = FunctionTagging.tagBiFunction(new BiFunction<Integer, Integer, Integer>() { @Override public Integer apply(Integer a, Integer b) throws Exception { f = FunctionTagging.tagBiFunction(new BiFunction<Integer, Integer, Integer>() { @Override public Integer apply(Integer a, Integer b) throws Exception { FunctionTagging.enable(); f = FunctionTagging.tagBiFunction(new BiFunction<Integer, Integer, Integer>() { @Override public Integer apply(Integer a, Integer b) throws Exception { f = FunctionTagging.tagBiFunction(new BiFunction<Integer, Integer, Integer>() { @Override public Integer apply(Integer a, Integer b) throws Exception { f = FunctionTagging.tagBiFunction(new BiFunction<Integer, Integer, Integer>() { @Override public Integer apply(Integer a, Integer b) throws Exception { f = FunctionTagging.tagBiFunction(new BiFunction<Integer, Integer, Integer>() { @Override
@Test public void f7Tag() throws Exception { boolean enabled = FunctionTagging.isEnabled(); try { Function7<Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer> f; int k = 7; FunctionTagging.disable(); f = FunctionTagging.tagFunction7( new FunctionTaggingComposite(i, false, false), "Custom tag"); FunctionTagging.enable(); f = FunctionTagging.tagFunction7( new FunctionTaggingComposite(i, false, false), "Custom tag"); f = FunctionTagging.tagFunction7( new FunctionTaggingComposite(0, true, false), "Custom tag"); f = FunctionTagging.tagFunction7( new FunctionTaggingComposite(0, false, true), "Custom tag"); FunctionTagging.disable();
@Test public void f5Tag() throws Exception { boolean enabled = FunctionTagging.isEnabled(); try { FunctionTagging.disable(); Function5<Integer, Integer, Integer, Integer, Integer, Integer> f = FunctionTagging.tagFunction5( new FunctionTaggingComposite(i, false, false), "Custom tag"); FunctionTagging.enable(); Function5<Integer, Integer, Integer, Integer, Integer, Integer> f = FunctionTagging.tagFunction5( new FunctionTaggingComposite(i, false, false), "Custom tag"); Function5<Integer, Integer, Integer, Integer, Integer, Integer> f = FunctionTagging.tagFunction5( new FunctionTaggingComposite(0, true, false), "Custom tag"); f = FunctionTagging.tagFunction5( new FunctionTaggingComposite(0, false, true), "Custom tag"); FunctionTagging.disable();
@Test public void f8Tag() throws Exception { boolean enabled = FunctionTagging.isEnabled(); try { Function8<Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer> f; int k = 8; FunctionTagging.disable(); f = FunctionTagging.tagFunction8( new FunctionTaggingComposite(i, false, false), "Custom tag"); FunctionTagging.enable(); f = FunctionTagging.tagFunction8( new FunctionTaggingComposite(i, false, false), "Custom tag"); f = FunctionTagging.tagFunction8( new FunctionTaggingComposite(0, true, false), "Custom tag"); f = FunctionTagging.tagFunction8( new FunctionTaggingComposite(0, false, true), "Custom tag"); FunctionTagging.disable();
@Test public void f9Tag() throws Exception { boolean enabled = FunctionTagging.isEnabled(); try { Function9<Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer> f; int k = 9; FunctionTagging.disable(); f = FunctionTagging.tagFunction9( new FunctionTaggingComposite(i, false, false), "Custom tag"); FunctionTagging.enable(); f = FunctionTagging.tagFunction9( new FunctionTaggingComposite(i, false, false), "Custom tag"); f = FunctionTagging.tagFunction9( new FunctionTaggingComposite(0, true, false), "Custom tag"); f = FunctionTagging.tagFunction9( new FunctionTaggingComposite(0, false, true), "Custom tag"); FunctionTagging.disable();
@Test public void f3Tag() throws Exception { boolean enabled = FunctionTagging.isEnabled(); try { FunctionTagging.disable(); Function3<Integer, Integer, Integer, Integer> f = FunctionTagging.tagFunction3(new Function3<Integer, Integer, Integer, Integer>() { @Override public Integer apply(Integer a, Integer b, Integer c) throws Exception { f = FunctionTagging.tagFunction3(new Function3<Integer, Integer, Integer, Integer>() { @Override public Integer apply(Integer a, Integer b, Integer c) throws Exception { f = FunctionTagging.tagFunction3(new Function3<Integer, Integer, Integer, Integer>() { @Override public Integer apply(Integer a, Integer b, Integer c) throws Exception { FunctionTagging.enable(); f = FunctionTagging.tagFunction3(new Function3<Integer, Integer, Integer, Integer>() { @Override public Integer apply(Integer a, Integer b, Integer c) throws Exception { f = FunctionTagging.tagFunction3(new Function3<Integer, Integer, Integer, Integer>() { @Override public Integer apply(Integer a, Integer b, Integer c) throws Exception { f = FunctionTagging.tagFunction3(new Function3<Integer, Integer, Integer, Integer>() { @Override
@Test public void f4Tag() throws Exception { boolean enabled = FunctionTagging.isEnabled(); try { FunctionTagging.disable(); Function4<Integer, Integer, Integer, Integer, Integer> f = FunctionTagging.tagFunction4( new Function4<Integer, Integer, Integer, Integer, Integer>() { @Override f = FunctionTagging.tagFunction4( new Function4<Integer, Integer, Integer, Integer, Integer>() { @Override f = FunctionTagging.tagFunction4( new Function4<Integer, Integer, Integer, Integer, Integer>() { @Override f = FunctionTagging.tagFunction4( new Function4<Integer, Integer, Integer, Integer, Integer>() { @Override FunctionTagging.enable(); f = FunctionTagging.tagFunction4( new Function4<Integer, Integer, Integer, Integer, Integer>() { @Override f = FunctionTagging.tagFunction4( new Function4<Integer, Integer, Integer, Integer, Integer>() {
@Override public R apply(T1 t1, T2 t2, T3 t3) throws Exception { if (t1 == null) { throw new NullPointerException("t1 is null, tag = " + tag); } if (t2 == null) { throw new NullPointerException("t2 is null, tag = " + tag); } if (t3 == null) { throw new NullPointerException("t3 is null, tag = " + tag); } R v; try { v = actual.apply(t1, t2, t3); } catch (Throwable ex) { throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex)); } if (v == null) { throw new NullPointerException("The BiFunction returned null, tag = " + tag); } return v; } }
@Override public R apply(T t) throws Exception { if (t == null) { throw new NullPointerException("t is null, tag = " + tag); } R v; try { v = actual.apply(t); } catch (Throwable ex) { throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex)); } if (v == null) { throw new NullPointerException("The Function returned null, tag = " + tag); } return v; } }
@Override public R apply(T1 t1, T2 t2, T3 t3, T4 t4) throws Exception { if (t1 == null) { throw new NullPointerException("t1 is null, tag = " + tag); } if (t2 == null) { throw new NullPointerException("t2 is null, tag = " + tag); } if (t3 == null) { throw new NullPointerException("t3 is null, tag = " + tag); } if (t4 == null) { throw new NullPointerException("t4 is null, tag = " + tag); } R v; try { v = actual.apply(t1, t2, t3, t4); } catch (Throwable ex) { throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex)); } if (v == null) { throw new NullPointerException("The BiFunction returned null, tag = " + tag); } return v; } }
@Override public R apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Exception { if (t1 == null) { throw new NullPointerException("t1 is null, tag = " + tag); } if (t2 == null) { throw new NullPointerException("t2 is null, tag = " + tag); } if (t3 == null) { throw new NullPointerException("t3 is null, tag = " + tag); } if (t4 == null) { throw new NullPointerException("t4 is null, tag = " + tag); } if (t5 == null) { throw new NullPointerException("t5 is null, tag = " + tag); } R v; try { v = actual.apply(t1, t2, t3, t4, t5); } catch (Throwable ex) { throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex)); } if (v == null) { throw new NullPointerException("The BiFunction returned null, tag = " + tag); } return v; } }
v = actual.apply(t1, t2, t3, t4, t5, t6, t7); } catch (Throwable ex) { throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex));
v = actual.apply(t1, t2, t3, t4, t5, t6, t7); } catch (Throwable ex) { throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex));
@Override public R apply(T1 t1, T2 t2, T3 t3, T4 t4) throws Exception { if (t1 == null) { throw new NullPointerException("t1 is null, tag = " + tag); } if (t2 == null) { throw new NullPointerException("t2 is null, tag = " + tag); } if (t3 == null) { throw new NullPointerException("t3 is null, tag = " + tag); } if (t4 == null) { throw new NullPointerException("t4 is null, tag = " + tag); } R v; try { v = actual.apply(t1, t2, t3, t4); } catch (Throwable ex) { throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex)); } if (v == null) { throw new NullPointerException("The BiFunction returned null, tag = " + tag); } return v; } }
@Override public R apply(T1 t1, T2 t2, T3 t3) throws Exception { if (t1 == null) { throw new NullPointerException("t1 is null, tag = " + tag); } if (t2 == null) { throw new NullPointerException("t2 is null, tag = " + tag); } if (t3 == null) { throw new NullPointerException("t3 is null, tag = " + tag); } R v; try { v = actual.apply(t1, t2, t3); } catch (Throwable ex) { throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex)); } if (v == null) { throw new NullPointerException("The BiFunction returned null, tag = " + tag); } return v; } }
@Override public R apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) throws Exception { if (t1 == null) { throw new NullPointerException("t1 is null, tag = " + tag); } if (t2 == null) { throw new NullPointerException("t2 is null, tag = " + tag); } if (t3 == null) { throw new NullPointerException("t3 is null, tag = " + tag); } if (t4 == null) { throw new NullPointerException("t4 is null, tag = " + tag); } if (t5 == null) { throw new NullPointerException("t5 is null, tag = " + tag); } R v; try { v = actual.apply(t1, t2, t3, t4, t5); } catch (Throwable ex) { throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex)); } if (v == null) { throw new NullPointerException("The BiFunction returned null, tag = " + tag); } return v; } }
v = actual.apply(t1, t2, t3, t4, t5, t6); } catch (Throwable ex) { throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex));