@Override protected Map<Object,Object> initialValue() { return CollectionFactory.newMap(); } }
/** * {@inheritDoc} */ @Override public List<String> getMappingFileNames() { List<String> tmp = CollectionFactory.newList(mappingFilesNames); return Collections.unmodifiableList(tmp); }
/** * Creates a {@link BaseCCD}. * * @param annotationClass * Type of the constraint annotation * @param attributes * Attribute names of the constraint annotation to be passed (along with their values) to the JavaScript validator * function as an {@link JSONObject}. */ public BaseCCD(Class annotationClass, String... attributes) { this.annotationClass = annotationClass; this.attributes = newSet(attributes); }
@SuppressWarnings("unchecked") private <K, V> Map<K, V> newConfigurationMap(Class<K> keyType) { if (keyType.equals(String.class)) { Map<String, K> result = CollectionFactory.newCaseInsensitiveMap(); return (Map<K, V>) result; } return CollectionFactory.newMap(); }
public void addMixinClassName(String mixinClassName, String... order) { if (mixinClassNames == null) mixinClassNames = CollectionFactory.newList(); mixinClassNames.add(mixinClassName); if (order != null && order.length > 0) { if (mixinOrders == null) mixinOrders = CollectionFactory.newCaseInsensitiveMap(); mixinOrders.put(mixinClassName, order); } }
public MethodIterator(Class subjectClass) { Method[] methods = subjectClass.getMethods(); Map<String, MethodSignature> map = newMap(); for (int i = 0; i < methods.length; i++) processMethod(methods[i], map); signatures = newList(map.values()); count = signatures.size(); Collections.sort(signatures, COMPARATOR); }
private <T> T getServiceByTypeAndMarkers(Class<T> serviceInterface, Class<? extends Annotation>... markerTypes) { if (markerTypes.length == 0) { return getServiceByTypeAlone(serviceInterface); } AnnotationProvider provider = createAnnotationProvider(markerTypes); Set<ServiceDef2> matches = CollectionFactory.newSet(); List<Class> markers = CollectionFactory.newList(); findServiceDefsMatchingMarkerAndType(serviceInterface, provider, null, markers, matches); return extractServiceFromMatches(serviceInterface, markers, matches); }
public void setBound(String parameterName) { if (bound == null) bound = CollectionFactory.newCaseInsensitiveMap(); bound.put(parameterName, true); }
@SuppressWarnings("unchecked") private <T> LinkedList<T> stackFor(Class<T> type) { lock.check(); LinkedList<T> result = typeToStack.get(type); if (result == null) { result = CollectionFactory.newLinkedList(); typeToStack.put(type, result); } return result; }
void onActivate() { if (database == null) { database = CollectionFactory.newConcurrentMap(); } }
public MethodIterator(Class subjectClass) { Method[] methods = subjectClass.getMethods(); Map<String, MethodSignature> map = newMap(); for (int i = 0; i < methods.length; i++) processMethod(methods[i], map); signatures = newList(map.values()); count = signatures.size(); Collections.sort(signatures, COMPARATOR); }
public void addMixin(String mixinClassName, String... constraints) { if (mixinClassNames == null) { mixinClassNames = CollectionFactory.newList(); mixinConstraints = CollectionFactory.newCaseInsensitiveMap(); } else { if (mixinClassNames.contains(mixinClassName)) throw new IllegalArgumentException(String.format("Mixin %s (for component %s) has already been defined.", mixinClassName, id)); } mixinClassNames.add(mixinClassName); mixinConstraints.put(mixinClassName, constraints); }
private <T> T getServiceByTypeAndMarkers(Class<T> serviceInterface, Class<? extends Annotation>... markerTypes) { if (markerTypes.length == 0) { return getServiceByTypeAlone(serviceInterface); } AnnotationProvider provider = createAnnotationProvider(markerTypes); Set<ServiceDef2> matches = CollectionFactory.newSet(); List<Class> markers = CollectionFactory.newList(); findServiceDefsMatchingMarkerAndType(serviceInterface, provider, null, markers, matches); return extractServiceFromMatches(serviceInterface, markers, matches); }
@SuppressWarnings("unchecked") private <K, V> Map<K, V> newConfigurationMap(Class<K> keyType) { if (keyType.equals(String.class)) { Map<String, K> result = CollectionFactory.newCaseInsensitiveMap(); return (Map<K, V>) result; } return CollectionFactory.newMap(); }
public void addEventHandler(String eventType) { if (handledEvents == null) handledEvents = CollectionFactory.newCaseInsensitiveMap(); handledEvents.put(eventType, true); }
private static void addPropertiesFromExtendedInterfaces(Class forClass, List<PropertyDescriptor> descriptors) throws IntrospectionException { Class[] interfaces = forClass.getInterfaces(); if (interfaces.length == 0){ return; } LinkedList<Class> queue = CollectionFactory.newLinkedList(); // Seed the queue addInterfacesRecursively(queue, forClass); while (!queue.isEmpty()) { Class c = queue.removeFirst(); BeanInfo info = Introspector.getBeanInfo(c); // Duplicates occur and are filtered out in ClassPropertyAdapter which stores // a property name to descriptor map. addAll(descriptors, info.getPropertyDescriptors()); } }
@Override protected Map initialValue() { return CollectionFactory.newMap(); } }
/** * {@inheritDoc} */ @Override public List<String> getManagedClassNames() { List<String> tmp = CollectionFactory.newList(managedClassNames); return Collections.<String>unmodifiableList(tmp); }
public SyntheticModuleDef(ContributionDef... contributionDefs) { this.contributionDefs = CollectionFactory.newSet(contributionDefs); }
public BeanModel<T> include(String... propertyNames) { List<String> reorderedPropertyNames = CollectionFactory.newList(); Map<String, PropertyModel> reduced = CollectionFactory.newCaseInsensitiveMap(); for (String name : propertyNames) { PropertyModel model = get(name); String canonical = model.getPropertyName(); reorderedPropertyNames.add(canonical); reduced.put(canonical, model); } this.propertyNames.clear(); this.propertyNames.addAll(reorderedPropertyNames); properties.clear(); properties.putAll(reduced); return this; }