public void addValueArray(Object values) { CollectionUtils.mergeArrayIntoCollection(values, this.values); }
private List<HandlerInterceptor> initInterceptorList() { if (this.interceptorList == null) { this.interceptorList = new ArrayList<>(); if (this.interceptors != null) { // An interceptor array specified through the constructor CollectionUtils.mergeArrayIntoCollection(this.interceptors, this.interceptorList); } } this.interceptors = null; return this.interceptorList; }
public void addValueArray(Object values) { CollectionUtils.mergeArrayIntoCollection(values, this.values); }
public void addInterceptors(HandlerInterceptor... interceptors) { if (!ObjectUtils.isEmpty(interceptors)) { CollectionUtils.mergeArrayIntoCollection(interceptors, initInterceptorList()); } }
private List<HandlerInterceptor> initInterceptorList() { if (this.interceptorList == null) { this.interceptorList = new ArrayList<>(); if (this.interceptors != null) { // An interceptor array specified through the constructor CollectionUtils.mergeArrayIntoCollection(this.interceptors, this.interceptorList); } } this.interceptors = null; return this.interceptorList; }
public void addValueArray(Object values) { CollectionUtils.mergeArrayIntoCollection(values, this.values); }
/** * Create a new HandlerExecutionChain. * @param handler the handler object to execute * @param interceptors the array of interceptors to apply * (in the given order) before the handler itself executes */ public HandlerExecutionChain(Object handler, @Nullable HandlerInterceptor... interceptors) { if (handler instanceof HandlerExecutionChain) { HandlerExecutionChain originalChain = (HandlerExecutionChain) handler; this.handler = originalChain.getHandler(); this.interceptorList = new ArrayList<>(); CollectionUtils.mergeArrayIntoCollection(originalChain.getInterceptors(), this.interceptorList); CollectionUtils.mergeArrayIntoCollection(interceptors, this.interceptorList); } else { this.handler = handler; this.interceptors = interceptors; } }
public void addInterceptors(HandlerInterceptor... interceptors) { if (!ObjectUtils.isEmpty(interceptors)) { CollectionUtils.mergeArrayIntoCollection(interceptors, initInterceptorList()); } }
/** * Create a new HandlerExecutionChain. * @param handler the handler object to execute * @param interceptors the array of interceptors to apply * (in the given order) before the handler itself executes */ public HandlerExecutionChain(Object handler, @Nullable HandlerInterceptor... interceptors) { if (handler instanceof HandlerExecutionChain) { HandlerExecutionChain originalChain = (HandlerExecutionChain) handler; this.handler = originalChain.getHandler(); this.interceptorList = new ArrayList<>(); CollectionUtils.mergeArrayIntoCollection(originalChain.getInterceptors(), this.interceptorList); CollectionUtils.mergeArrayIntoCollection(interceptors, this.interceptorList); } else { this.handler = handler; this.interceptors = interceptors; } }
@Test public void testMergePrimitiveArrayIntoCollection() { int[] arr = new int[] {1, 2}; List<Comparable<?>> list = new LinkedList<>(); list.add(Integer.valueOf(3)); CollectionUtils.mergeArrayIntoCollection(arr, list); assertEquals(Integer.valueOf(3), list.get(0)); assertEquals(Integer.valueOf(1), list.get(1)); assertEquals(Integer.valueOf(2), list.get(2)); }
@Test public void testMergeArrayIntoCollection() { Object[] arr = new Object[] {"value1", "value2"}; List<Comparable<?>> list = new LinkedList<>(); list.add("value3"); CollectionUtils.mergeArrayIntoCollection(arr, list); assertEquals("value3", list.get(0)); assertEquals("value1", list.get(1)); assertEquals("value2", list.get(2)); }
public void addValueArray(Object values) { CollectionUtils.mergeArrayIntoCollection(values, this.values); }
public void addValueArray(Object values) { CollectionUtils.mergeArrayIntoCollection(values, this.values); }
private List<HandlerInterceptor> initInterceptorList() { if (this.interceptorList == null) { this.interceptorList = new ArrayList<HandlerInterceptor>(); if (this.interceptors != null) { // An interceptor array specified through the constructor CollectionUtils.mergeArrayIntoCollection(this.interceptors, this.interceptorList); } } this.interceptors = null; return this.interceptorList; }
private List<HandlerInterceptor> initInterceptorList() { if (this.interceptorList == null) { this.interceptorList = new ArrayList<HandlerInterceptor>(); if (this.interceptors != null) { // An interceptor array specified through the constructor CollectionUtils.mergeArrayIntoCollection(this.interceptors, this.interceptorList); } } this.interceptors = null; return this.interceptorList; }
public void addInterceptors(HandlerInterceptor... interceptors) { if (!ObjectUtils.isEmpty(interceptors)) { CollectionUtils.mergeArrayIntoCollection(interceptors, initInterceptorList()); } }
public void addInterceptors(HandlerInterceptor... interceptors) { if (!ObjectUtils.isEmpty(interceptors)) { CollectionUtils.mergeArrayIntoCollection(interceptors, initInterceptorList()); } }
private static Class<?>[] getVisibleClasses(Class<?>[] classes, ClassLoaderBridge loader) { if (ObjectUtils.isEmpty(classes)) return classes; Set<Class<?>> classSet = new LinkedHashSet<Class<?>>(classes.length); CollectionUtils.mergeArrayIntoCollection(classes, classSet); // filter class collection based on visibility for (Iterator<Class<?>> iter = classSet.iterator(); iter.hasNext();) { Class<?> clzz = iter.next(); if (!loader.canSee(clzz.getName())) { iter.remove(); } } return (Class[]) classSet.toArray(new Class[classSet.size()]); }
public Set<String> getComponentIds() { String[] names = getBeanFactory().getBeanDefinitionNames(); Set<String> components = new LinkedHashSet<String>(names.length); CollectionUtils.mergeArrayIntoCollection(names, components); Set<String> filtered = MetadataFactory.filterIds(components); return Collections.unmodifiableSet(filtered); }
public Builder to(String... destinations) { if (cf.getDestination() == null) { cf.setDestination(Arrays.asList(destinations)); } else { ArrayList<String> values = new ArrayList<>(cf.getDestination()); CollectionUtils.mergeArrayIntoCollection(destinations, values); cf.setDestination(values); } return this; }