public class AttributeListUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Map |
asNameMap(AttributeList al)
Returns the given list as a map of attributes, keyed on the names of the
attribute in the list.
|
static boolean |
containsNamedAttribute(AttributeList al,
Attribute a)
Checks whether an attribute with the name same as that of the given
attribute exists in this list.
|
static boolean |
containsNamedAttribute(AttributeList al,
String name)
Checks whether this list contains a JMX
Attribute with given
name. |
static String |
dash2CamelCase(String dashed) |
static String |
toJmx12Attribute(String name)
JMX 1.2 specification had a weird limitation that a Dynamic MBean may not
have an attribute whose name is not a valid Java identifier .
|
static String |
toString(AttributeList al)
Returns a String representation of an attribute list such that:
Each attribute is a name and value separated by a ','.
|
public static boolean containsNamedAttribute(AttributeList al, String name)
Attribute
with given
name. Note that this method will return true if there is at least one
attribute with given name.al
- an instance of AttributeList
name
- a String representing the name of the attribute. The name may
not be null.IllegalArgumentException
- if the attribute list or name is nullpublic static boolean containsNamedAttribute(AttributeList al, Attribute a)
al
- an instance of AttributeList
a
- an Attribute with a name and a valueIllegalArgumentException
- if the attribute list or name is nullpublic static Map asNameMap(AttributeList al)
al
- the list of attributes that need to be mappedMap
IllegalArgumentException
- if the argument is nullpublic static String toJmx12Attribute(String name)
name
- a String that represents any non null nameIllegalArgumentException
- if the parameter is null or is of zero
lengthpublic static String toString(AttributeList al)
al
- the list of attributes - may be null, in which case an empty
String is returned.Copyright © 2019. All rights reserved.