12
12
13
13
/**
14
14
* Provides utilities related to working with names of JBoss Modules modules.
15
- *
16
- * @deprecated use {@link JBossModulesNameUtil} instead
17
15
*/
18
- @ Deprecated (forRemoval = true , since = "28.0.0" )
19
16
public final class ModuleIdentifierUtil {
20
17
21
18
/**
@@ -26,30 +23,39 @@ public final class ModuleIdentifierUtil {
26
23
* @param moduleSpec a module name specification in the form {@code name[:slot]}. Cannot be {@code null}
27
24
* @return the canonical representation. Will not return @{code null}
28
25
*
29
- * @deprecated use {@link JBossModulesNameUtil #parseCanonicalModuleIdentifier(String)}
26
+ * @deprecated use {@link #parseCanonicalModuleIdentifier(String)}
30
27
*/
31
28
@ Deprecated (forRemoval = true , since = "28.0.0" )
32
29
public static String canonicalModuleIdentifier (String moduleSpec ) {
33
30
return JBossModulesNameUtil .parseCanonicalModuleIdentifier (moduleSpec );
34
31
}
35
32
33
+ /**
34
+ * Provides the canonical string representation of a module identifier from a string
35
+ * of the form {@code name[:slot]}. The canonical representation will not include
36
+ * slot information if the slot is {@code main}.
37
+ *
38
+ * @param moduleSpec a module name specification in the form {@code name[:slot]}. Cannot be {@code null}
39
+ * @return the canonical representation. Will not return @{code null}
40
+ */
41
+ public static String parseCanonicalModuleIdentifier (String moduleSpec ) {
42
+ return JBossModulesNameUtil .parseCanonicalModuleIdentifier (moduleSpec );
43
+ }
44
+
36
45
/**
37
46
* Parses the given module identifier into name and optional slot elements, passing those to the given
38
47
* function and returning the result of that function.
39
48
* <p/>
40
- * This variant does not {@link #canonicalModuleIdentifier (String) canonicalize} the given identifier.
49
+ * This variant does not {@link #parseCanonicalModuleIdentifier (String) canonicalize} the given identifier.
41
50
*
42
51
* @param moduleIdentifier an identifier for a module. Cannot be {@code null}
43
- * @param function a function to apply to the module's name and optional slot. Cannot be {@code null}.
44
- * The slot value passed to the function may be null if the identifier does not contain one.
52
+ * @param function a function to apply to the module's name and optional slot. Cannot be {@code null}.
53
+ * The slot value passed to the function may be null if the identifier does not contain one.
54
+ * @param <R> the type returned by {@code function}
45
55
* @return the value returned by {@code function}
46
- * @param <R> the type returned by {@code function}
47
- *
48
- * @deprecated use {@link JBossModulesNameUtil#parseModuleIdentifier(String, BiFunction)}
49
56
*/
50
- @ Deprecated (forRemoval = true , since = "28.0.0" )
51
57
public static <R > R parseModuleIdentifier (String moduleIdentifier , BiFunction <String , String , R > function ) {
52
- return JBossModulesNameUtil .parseModuleIdentifier (moduleIdentifier , function );
58
+ return JBossModulesNameUtil .parseModuleIdentifier (moduleIdentifier , function , false , null );
53
59
}
54
60
55
61
@@ -59,36 +65,29 @@ public static <R> R parseModuleIdentifier(String moduleIdentifier, BiFunction<St
59
65
* <p/>
60
66
*
61
67
* @param moduleIdentifier an identifier for a module. Cannot be {@code null}
62
- * @param function a function to apply to the module's name and optional slot. Cannot be {@code null}.
63
- * The slot value passed to the function may be null if the identifier does not contain one.
64
- * @param canonicalize if {@code true} the identifier will be {@link #canonicalModuleIdentifier(String) canonicalized} before parsing
68
+ * @param function a function to apply to the module's name and optional slot. Cannot be {@code null}.
69
+ * The slot value passed to the function may be null if the identifier does not contain one.
70
+ * @param canonicalize if {@code true} the identifier will be {@link #parseCanonicalModuleIdentifier(String) canonicalized} before parsing
71
+ * @param <R> the type returned by {@code function}
65
72
* @return the value returned by {@code function}
66
- * @param <R> the type returned by {@code function}
67
- *
68
- * @deprecated use {@link JBossModulesNameUtil#parseModuleIdentifier(String, BiFunction, boolean)}
69
73
*/
70
- @ Deprecated (forRemoval = true , since = "28.0.0" )
71
74
public static <R > R parseModuleIdentifier (String moduleIdentifier , BiFunction <String , String , R > function , boolean canonicalize ) {
72
- return JBossModulesNameUtil .parseModuleIdentifier (moduleIdentifier , function , canonicalize );
75
+ return JBossModulesNameUtil .parseModuleIdentifier (moduleIdentifier , function , canonicalize , null );
73
76
}
74
77
75
-
76
78
/**
77
79
* Parses the given module identifier into name and optional slot elements, passing those to the given
78
80
* function and returning the result of that function.
79
81
* <p/>
80
82
*
81
83
* @param moduleIdentifier an identifier for a module. Cannot be {@code null}
82
- * @param function a function to apply to the module's name and optional slot. Cannot be {@code null}.
83
- * The slot value passed to the function may be null if the identifier does not contain one.
84
- * @param canonicalize if {@code true} the identifier will be {@link #canonicalModuleIdentifier(String) canonicalized} before parsing
85
- * @param defaultSlot string to pass to {@code function} as the slot parameter if the identifier doesn't include a slot value. May be {@code null}
84
+ * @param function a function to apply to the module's name and optional slot. Cannot be {@code null}.
85
+ * The slot value passed to the function may be null if the identifier does not contain one.
86
+ * @param canonicalize if {@code true} the identifier will be {@link #parseCanonicalModuleIdentifier(String) canonicalized} before parsing
87
+ * @param defaultSlot string to pass to {@code function} as the slot parameter if the identifier doesn't include a slot value. May be {@code null}
88
+ * @param <R> the type returned by {@code function}
86
89
* @return the value returned by {@code function}
87
- * @param <R> the type returned by {@code function}
88
- *
89
- * @deprecated use {@link JBossModulesNameUtil#parseModuleIdentifier(String, BiFunction, boolean, String)}
90
90
*/
91
- @ Deprecated (forRemoval = true , since = "28.0.0" )
92
91
public static <R > R parseModuleIdentifier (String moduleIdentifier , BiFunction <String , String , R > function ,
93
92
boolean canonicalize , String defaultSlot ) {
94
93
return JBossModulesNameUtil .parseModuleIdentifier (moduleIdentifier , function , canonicalize , defaultSlot );
@@ -101,29 +100,22 @@ public static <R> R parseModuleIdentifier(String moduleIdentifier, BiFunction<St
101
100
*
102
101
* @param name the base module name. Cannot be {@code null}
103
102
* @param slot the module slot. May be @{code null}
104
- *
105
103
* @return the canonical representation. Will not return @{code null}
106
- *
107
- * @deprecated use {@link JBossModulesNameUtil#canonicalModuleIdentifier(String, String)}
108
104
*/
109
- @ Deprecated (forRemoval = true , since = "28.0.0" )
110
105
public static String canonicalModuleIdentifier (String name , String slot ) {
111
106
return JBossModulesNameUtil .canonicalModuleIdentifier (name , slot );
112
107
}
113
108
114
109
/**
115
- * A {@link ParameterCorrector} that {@link #canonicalModuleIdentifier (String) canonicalizes}
110
+ * A {@link ParameterCorrector} that {@link #parseCanonicalModuleIdentifier (String) canonicalizes}
116
111
* values that are meant to represent JBoss Modules module names.
117
- *
118
- * @deprecated use {@link JBossModulesNameUtil#parseCanonicalModuleIdentifier} after resolving your attribute value in your step handler.
119
112
*/
120
- @ Deprecated (forRemoval = true , since = "28.0.0" )
121
113
public static final ParameterCorrector MODULE_NAME_CORRECTOR = new ParameterCorrector () {
122
114
@ Override
123
115
public ModelNode correct (ModelNode newValue , ModelNode currentValue ) {
124
116
if (ModelType .STRING .equals (newValue .getType ())) {
125
117
String orig = newValue .asString ();
126
- String corrected = canonicalModuleIdentifier (orig );
118
+ String corrected = parseCanonicalModuleIdentifier (orig );
127
119
if (!orig .equals (corrected )) {
128
120
newValue .set (corrected );
129
121
}
0 commit comments