@Override public void freezeConfiguration() { this.configurationFrozen = true; this.frozenBeanDefinitionNames = StringUtils.toStringArray(this.beanDefinitionNames); }
@Override public String[] getSingletonNames() { synchronized (this.singletonObjects) { return StringUtils.toStringArray(this.registeredSingletons); } }
/** * Return the list of fields that were suppressed during the bind process. * <p>Can be used to determine whether any field values were targeting * disallowed fields. * @see DataBinder#setAllowedFields */ @Override public String[] getSuppressedFields() { return StringUtils.toStringArray(this.suppressedFields); }
/** * Create a new HttpRequestMethodNotSupportedException. * @param method the unsupported HTTP request method * @param supportedMethods the actually supported HTTP methods (may be {@code null}) */ public HttpRequestMethodNotSupportedException(String method, @Nullable Collection<String> supportedMethods) { this(method, (supportedMethods != null ? StringUtils.toStringArray(supportedMethods) : null)); }
/** * Copy the given Enumeration into a {@code String} array. * The Enumeration must contain {@code String} elements only. * @param enumeration the Enumeration to copy * @return the {@code String} array */ public static String[] toStringArray(Enumeration<String> enumeration) { return toStringArray(Collections.list(enumeration)); }
/** * Return the HTTP methods that this content generator supports. */ @Nullable public final String[] getSupportedMethods() { return (this.supportedMethods != null ? StringUtils.toStringArray(this.supportedMethods) : null); }
@Override @Nullable public String[] getParameterNames() { return StringUtils.toStringArray(this.values.keySet()); }
private static String[] processActiveProfiles(@Nullable String[] activeProfiles) { if (activeProfiles == null) { return EMPTY_STRING_ARRAY; } // Active profiles must be unique Set<String> profilesSet = new LinkedHashSet<>(Arrays.asList(activeProfiles)); return StringUtils.toStringArray(profilesSet); }
/** * Return the imports to use if the {@link AdviceMode} is set to {@link AdviceMode#ASPECTJ}. * <p>Take care of adding the necessary JSR-107 import if it is available. */ private String[] getAspectJImports() { List<String> result = new ArrayList<>(2); result.add(CACHE_ASPECT_CONFIGURATION_CLASS_NAME); if (jsr107Present && jcacheImplPresent) { result.add(JCACHE_ASPECT_CONFIGURATION_CLASS_NAME); } return StringUtils.toStringArray(result); }
@Override public String[] getMemberClassNames() { LinkedHashSet<String> memberClassNames = new LinkedHashSet<>(4); for (Class<?> nestedClass : this.introspectedClass.getDeclaredClasses()) { memberClassNames.add(nestedClass.getName()); } return StringUtils.toStringArray(memberClassNames); }
private static String[] calculateMatches(final String name, Class<?> clazz, final int maxDistance) { final List<String> candidates = new ArrayList<>(); ReflectionUtils.doWithFields(clazz, field -> { String possibleAlternative = field.getName(); if (calculateStringDistance(name, possibleAlternative) <= maxDistance) { candidates.add(possibleAlternative); } }); Collections.sort(candidates); return StringUtils.toStringArray(candidates); }
@Override @Nullable public String[] getHeaderValues(String headerName) { String[] headerValues = StringUtils.toStringArray(getRequest().getHeaders(headerName)); return (!ObjectUtils.isEmpty(headerValues) ? headerValues : null); }
@Override public String[] getValueNames() { assertIsValid(); return StringUtils.toStringArray(this.attributes.keySet()); }
@Override public String[] getBeanDefinitionNames() { String[] frozenNames = this.frozenBeanDefinitionNames; if (frozenNames != null) { return frozenNames.clone(); } else { return StringUtils.toStringArray(this.beanDefinitionNames); } }
@Override public String[] getAliases(String name) { List<String> result = new ArrayList<>(); synchronized (this.aliasMap) { retrieveAliases(name, result); } return StringUtils.toStringArray(result); }
@Override public String[] getPropertyNames() { Set<String> names = new LinkedHashSet<>(); for (PropertySource<?> propertySource : this.propertySources) { if (!(propertySource instanceof EnumerablePropertySource)) { throw new IllegalStateException( "Failed to enumerate property names due to non-enumerable property source: " + propertySource); } names.addAll(Arrays.asList(((EnumerablePropertySource<?>) propertySource).getPropertyNames())); } return StringUtils.toStringArray(names); }
@Override public String[] getBeanNamesForAnnotation(Class<? extends Annotation> annotationType) { List<String> results = new ArrayList<>(); for (String beanName : this.beans.keySet()) { if (findAnnotationOnBean(beanName, annotationType) != null) { results.add(beanName); } } return StringUtils.toStringArray(results); }
/** * Get the property names for the option arguments. */ @Override public String[] getPropertyNames() { return StringUtils.toStringArray(this.source.getOptionNames()); }
@Override public String[] getValueNames() { assertIsValid(); return StringUtils.toStringArray(this.attributes.keySet()); }
@Override public String[] resolve(Class<?> testClass) { List<String> profiles = new ArrayList<>(Arrays.asList(super.resolve(testClass))); profiles.add("foo"); return StringUtils.toStringArray(profiles); } }