If the value stored under the specified {@code attributeName} is
+ * a string, it will be wrapped in a single-element array before
+ * returning it.
+ * @param attributeName the name of the attribute to get; never
+ * {@code null} or empty
+ * @return the value
+ * @throws IllegalArgumentException if the attribute does not exist or
+ * if it is not of the expected type
+ */
public String[] getStringArray(String attributeName) {
return doGet(attributeName, String[].class);
}
+ /**
+ * Get the value stored under the specified {@code attributeName} as a
+ * boolean.
+ * @param attributeName the name of the attribute to get; never
+ * {@code null} or empty
+ * @return the value
+ * @throws IllegalArgumentException if the attribute does not exist or
+ * if it is not of the expected type
+ */
public boolean getBoolean(String attributeName) {
return doGet(attributeName, Boolean.class);
}
+ /**
+ * Get the value stored under the specified {@code attributeName} as a
+ * number.
+ * @param attributeName the name of the attribute to get; never
+ * {@code null} or empty
+ * @return the value
+ * @throws IllegalArgumentException if the attribute does not exist or
+ * if it is not of the expected type
+ */
@SuppressWarnings("unchecked")
public If the value stored under the specified {@code attributeName} is
+ * a class, it will be wrapped in a single-element array before
+ * returning it.
+ * @param attributeName the name of the attribute to get; never
+ * {@code null} or empty
+ * @return the value
+ * @throws IllegalArgumentException if the attribute does not exist or
+ * if it is not of the expected type
+ */
public Class>[] getClassArray(String attributeName) {
return doGet(attributeName, Class[].class);
}
+ /**
+ * Get the {@link AnnotationAttributes} stored under the specified
+ * {@code attributeName}.
+ * @param attributeName the name of the attribute to get; never
+ * {@code null} or empty
+ * @return the {@code AnnotationAttributes}
+ * @throws IllegalArgumentException if the attribute does not exist or
+ * if it is not of the expected type
+ */
public AnnotationAttributes getAnnotation(String attributeName) {
return doGet(attributeName, AnnotationAttributes.class);
}
+ /**
+ * Get the array of {@link AnnotationAttributes} stored under the specified
+ * {@code attributeName}.
+ * If the value stored under the specified {@code attributeName} is
+ * an instance of {@code AnnotationAttributes}, it will be wrapped in
+ * a single-element array before returning it.
+ * @param attributeName the name of the attribute to get; never
+ * {@code null} or empty
+ * @return the array of {@code AnnotationAttributes}
+ * @throws IllegalArgumentException if the attribute does not exist or
+ * if it is not of the expected type
+ */
public AnnotationAttributes[] getAnnotationArray(String attributeName) {
return doGet(attributeName, AnnotationAttributes[].class);
}
+ /**
+ * Get the value stored under the specified {@code attributeName},
+ * ensuring that the value is of the {@code expectedType}.
+ * If the {@code expectedType} is an array and the value stored
+ * under the specified {@code attributeName} is a single element of the
+ * component type of the expected array type, the single element will be
+ * wrapped in a single-element array of the appropriate type before
+ * returning it.
+ * @param attributeName the name of the attribute to get; never
+ * {@code null} or empty
+ * @param expectedType the expected type; never {@code null}
+ * @return the value
+ * @throws IllegalArgumentException if the attribute does not exist or
+ * if it is not of the expected type
+ * @since 4.2
+ */
@SuppressWarnings("unchecked")
private