44
44
* @since 9
45
45
*/
46
46
public final class EventTypeInfo {
47
- private final List <SettingDescriptorInfo > settings ;
47
+ private final List <SettingDescriptorInfo > settingDescriptors ;
48
48
private final long id ;
49
49
private final String name ;
50
50
private final String description ;
@@ -53,7 +53,7 @@ public final class EventTypeInfo {
53
53
54
54
// package private
55
55
EventTypeInfo (EventType eventType ) {
56
- this .settings = creatingSettingDescriptorInfos (eventType );
56
+ this .settingDescriptors = creatingSettingDescriptorInfos (eventType );
57
57
this .id = eventType .getId ();
58
58
this .name = eventType .getName ();
59
59
this .label = eventType .getLabel ();
@@ -62,12 +62,20 @@ public final class EventTypeInfo {
62
62
}
63
63
64
64
private EventTypeInfo (CompositeData cd ) {
65
- this .settings = createSettings (cd .get ("settings" ));
65
+ if (cd .containsKey ("settings" )) {
66
+ this .settingDescriptors = createSettingDescriptors (cd .get ("settings" ));
67
+ } else {
68
+ this .settingDescriptors = createSettingDescriptors (cd .get ("settingDescriptors" ));
69
+ }
66
70
this .id = (long ) cd .get ("id" );
67
71
this .name = (String ) cd .get ("name" );
68
72
this .label = (String ) cd .get ("label" );
69
73
this .description = (String ) cd .get ("description" );
70
- this .categoryNames = createCategoryNames ((Object []) cd .get ("category" ));
74
+ if (cd .containsKey ("category" )) {
75
+ this .categoryNames = createCategoryNames ((Object []) cd .get ("category" ));
76
+ } else {
77
+ this .categoryNames = createCategoryNames ((Object []) cd .get ("categoryNames" ));
78
+ }
71
79
}
72
80
73
81
private static List <String > createCategoryNames (Object [] array ) {
@@ -87,7 +95,7 @@ private static List<SettingDescriptorInfo> creatingSettingDescriptorInfos(EventT
87
95
return Collections .unmodifiableList (settingDescriptorInfos );
88
96
}
89
97
90
- private static List <SettingDescriptorInfo > createSettings (Object settings ) {
98
+ private static List <SettingDescriptorInfo > createSettingDescriptors (Object settings ) {
91
99
if (settings instanceof Object [] settingsArray ) {
92
100
List <SettingDescriptorInfo > list = new ArrayList <>(settingsArray .length );
93
101
for (Object element : settingsArray ) {
@@ -174,7 +182,7 @@ public String getDescription() {
174
182
* @see EventType#getSettingDescriptors()
175
183
*/
176
184
public List <SettingDescriptorInfo > getSettingDescriptors () {
177
- return settings ;
185
+ return settingDescriptors ;
178
186
}
179
187
180
188
/**
@@ -229,11 +237,11 @@ public String toString() {
229
237
* <td>{@code String}</td>
230
238
* </tr>
231
239
* <tr>
232
- * <th scope="row">category </th>
240
+ * <th scope="row">categoryNames </th>
233
241
* <td><code>ArrayType(1, SimpleType.STRING)</code></td>
234
242
* </tr>
235
243
* <tr>
236
- * <th scope="row">settings </th>
244
+ * <th scope="row">settingDescriptors </th>
237
245
* <td>{@code javax.management.openmbean.CompositeData[]} whose element type
238
246
* is the mapped type for {@link SettingDescriptorInfo} as specified in the
239
247
* {@link SettingDescriptorInfo#from} method.</td>
0 commit comments