/** * Adds loader-only rules for classes which must be loaded using this * loader. */ public void addLoaderOnlyRules(String... packages) { loaderOnlyRules = ArraysUtil.join(loaderOnlyRules, packages); }
/** * Adds parent only rules for classes which must be loaded on the * parent loader. */ public void addParentOnlyRules(String... packages) { parentOnlyRules = ArraysUtil.join(parentOnlyRules, packages); }
/** * Appends list of interceptors to the list of action interceptors. */ public ActionBuilder interceptBy(final Class<? extends ActionInterceptor>... interceptors) { if (actionInterceptors == null) { actionInterceptors = interceptors; } else { actionInterceptors = ArraysUtil.join(actionInterceptors, interceptors); } return this; } /**
/** * Creates child Jerry. */ protected Jerry(final Jerry parent, final Node[] nodes1, final Node[] nodes2) { this.parent = parent; this.nodes = ArraysUtil.join(nodes1, nodes2); this.builder = parent.builder; }
/** * Excludes types. Supports interfaces and subclasses as well. */ public JsonSerializer excludeTypes(final Class... types) { if (excludedTypes == null) { excludedTypes = types; } else { excludedTypes = ArraysUtil.join(excludedTypes, types); } return this; }
/** * Adds parent only rules for classes which must be loaded on the * parent loader. */ public void addParentOnlyRules(final String... packages) { parentOnlyRules = ArraysUtil.join(parentOnlyRules, packages); }
/** * Adds loader-only rules for classes which must be loaded using this * loader. */ public void addLoaderOnlyRules(final String... packages) { loaderOnlyRules = ArraysUtil.join(loaderOnlyRules, packages); }
/** * Adds init methods. */ protected void addInitMethodPoints(final InitMethodPoint[] methods) { if (initMethods == null) { initMethods = methods; } else { initMethods = ArraysUtil.join(initMethods, methods); } }
/** * Adds destroy methods. */ protected void addDestroyMethodPoints(final DestroyMethodPoint[] methods) { if (destroyMethods == null) { destroyMethods = methods; } else { destroyMethods = ArraysUtil.join(destroyMethods, methods); } }
/** * Appends list of filter to the list of action filters. */ public ActionBuilder filterBy(final Class<? extends ActionFilter>... filters) { if (actionFilters == null) { actionFilters = filters; } else { actionFilters = ArraysUtil.join(actionFilters, filters); } return this; } /**
/** * Excludes type names. You can disable * serialization of properties that are of some type. * For example, you can disable properties of <code>InputStream</code>. * You can use wildcards to describe type names. */ public JsonSerializer excludeTypes(final String... typeNames) { if (excludedTypeNames == null) { excludedTypeNames = typeNames; } else { excludedTypeNames = ArraysUtil.join(excludedTypeNames, typeNames); } return this; }
/** * Joins arrays. Component type is resolved from the array argument. */ @SuppressWarnings({"unchecked"}) public static <T> T[] join(T[]... arrays) { Class<T> componentType = (Class<T>) arrays.getClass().getComponentType().getComponentType(); return join(componentType, arrays); }
/** * Joins arrays. Component type is resolved from the array argument. */ @SuppressWarnings({"unchecked"}) public static <T> T[] join(T[]... arrays) { Class<T> componentType = (Class<T>) arrays.getClass().getComponentType().getComponentType(); return join(componentType, arrays); }
/** * Appends one or more BCC addresses. * * @param bccs vararg of {@link EmailAddress}es to set. * @return this */ public Email bcc(final EmailAddress... bccs) { this.bcc = ArraysUtil.join(this.bcc, valueOrEmptyArray(bccs)); return _this(); }
/** * Appends CC addresses. * * @param ccs vararg of {@link EmailAddress}es to set. * @return this */ public T cc(final EmailAddress... ccs) { this.cc = ArraysUtil.join(this.cc, valueOrEmptyArray(ccs)); return _this(); }
/** * Appends REPLY-TO addresses. * * @param replyTo vararg of {@link EmailAddress}es to set. * @return this */ public T replyTo(final EmailAddress... replyTo) { this.replyTo = ArraysUtil.join(this.replyTo, valueOrEmptyArray(replyTo)); return _this(); }
@Test void testJoin() { assertArrayEquals(new int[] {}, ArraysUtil.join(new int[0])); assertArrayEquals(new int[] { 1, 2, 3, 4, 5 }, ArraysUtil.join(x)); assertArrayEquals(new int[] { 1, 2, 3, 4, 5, 11, 12, 13 }, ArraysUtil.join(x, y)); assertArrayEquals(new long[] { 1, 2, 3, 4, 5, 11, 12, 13 }, ArraysUtil.values(ArraysUtil.join(xx, yy))); assertArrayEquals(new int[] { 1, 2, 3, 4, 5, 11, 12, 13, 11, 12, 13 }, ArraysUtil.join(x, y, y)); assertArrayEquals(new long[] { 1, 2, 3, 4, 5, 11, 12, 13, 11, 12, 13 }, ArraysUtil.values(ArraysUtil.join(xx, yy, yy))); assertArrayEquals(new int[0], ArraysUtil.join(new int[0][])); assertArrayEquals(new int[] { 1, 2, 3, 4, 5 }, ArraysUtil.join(x)); assertEquals("[1, 2, 3, 4, 5, 11, 12, 13]", Arrays.toString(ArraysUtil.join(Number.class, new Number[][] { xx, yy }))); assertEquals("[1, 2, 3, 4, 5]", Arrays.toString(ArraysUtil.join(Number.class, new Number[][] { xx }))); assertEquals("[]", Arrays.toString(ArraysUtil.join(Number.class, new Number[][] {}))); assertArrayEquals(new String[0], ArraysUtil.join(new String[0][])); assertArrayEquals(new String[] {}, ArraysUtil.join(new String[0])); String[] strings1 = new String[] { "f", "o", "o" }; String[] strings2 = new String[] { "b", "a", "r" }; assertArrayEquals(new String[] { "f", "o", "o" }, ArraysUtil.join(strings1)); assertArrayEquals(new String[] { "f", "o", "o", "b", "a", "r" }, ArraysUtil.join(strings1, strings2)); assertArrayEquals(new byte[0], ArraysUtil.join(new byte[0][])); assertArrayEquals(new byte[] {}, ArraysUtil.join(new byte[0])); byte[] bytes1 = new byte[] { 1, 2 }; byte[] bytes2 = new byte[] { 3, 4 }; assertArrayEquals(new byte[] { 1, 2 }, ArraysUtil.join(bytes1)); assertArrayEquals(new byte[] { 1, 2, 3, 4 }, ArraysUtil.join(bytes1, bytes2));
/** * Adds init methods. */ public void addInitMethodPoints(InitMethodPoint[] methods) { if (initMethods == null) { initMethods = methods; } else { initMethods = ArraysUtil.join(initMethods, methods); } }
/** * Adds loader-only rules for classes which must be loaded using this * loader. */ public void addLoaderOnlyRules(final String... packages) { loaderOnlyRules = ArraysUtil.join(loaderOnlyRules, packages); }
/** * Adds init methods. */ protected void addInitMethodPoints(final InitMethodPoint[] methods) { if (initMethods == null) { initMethods = methods; } else { initMethods = ArraysUtil.join(initMethods, methods); } }