Package org.jboss.as.controller
Class ModuleIdentifierUtil
java.lang.Object
org.jboss.as.controller.ModuleIdentifierUtil
Provides utilities related to working with names of JBoss Modules modules.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParameterCorrectorAParameterCorrectorthatcanonicalizesvalues that are meant to represent JBoss Modules module names. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcanonicalModuleIdentifier(String name, String slot) Provides the canonical string representation of a module identifier from a base module name and an optional slot.static StringparseCanonicalModuleIdentifier(String moduleSpec) Provides the canonical string representation of a module identifier from a string of the formname[:slot].static <R> RparseModuleIdentifier(String moduleIdentifier, BiFunction<String, String, R> function) Parses the given module identifier into name and optional slot elements, passing those to the given function and returning the result of that function.static <R> RparseModuleIdentifier(String moduleIdentifier, BiFunction<String, String, R> function, boolean canonicalize) Parses the given module identifier into name and optional slot elements, passing those to the given function and returning the result of that function.static <R> RparseModuleIdentifier(String moduleIdentifier, BiFunction<String, String, R> function, boolean canonicalize, String defaultSlot) Parses the given module identifier into name and optional slot elements, passing those to the given function and returning the result of that function.
-
Field Details
-
MODULE_NAME_CORRECTOR
AParameterCorrectorthatcanonicalizesvalues that are meant to represent JBoss Modules module names.
-
-
Constructor Details
-
ModuleIdentifierUtil
public ModuleIdentifierUtil()
-
-
Method Details
-
parseCanonicalModuleIdentifier
Provides the canonical string representation of a module identifier from a string of the formname[:slot]. The canonical representation will not include slot information if the slot ismain.- Parameters:
moduleSpec- a module name specification in the formname[:slot]. Cannot benull- Returns:
- the canonical representation. Will not return @{code null}
-
parseModuleIdentifier
public static <R> R parseModuleIdentifier(String moduleIdentifier, BiFunction<String, String, R> function) Parses the given module identifier into name and optional slot elements, passing those to the given function and returning the result of that function. This variant does notcanonicalizethe given identifier.- Type Parameters:
R- the type returned byfunction- Parameters:
moduleIdentifier- an identifier for a module. Cannot benullfunction- a function to apply to the module's name and optional slot. Cannot benull. The slot value passed to the function may be null if the identifier does not contain one.- Returns:
- the value returned by
function
-
parseModuleIdentifier
public static <R> R parseModuleIdentifier(String moduleIdentifier, BiFunction<String, String, R> function, boolean canonicalize) Parses the given module identifier into name and optional slot elements, passing those to the given function and returning the result of that function.- Type Parameters:
R- the type returned byfunction- Parameters:
moduleIdentifier- an identifier for a module. Cannot benullfunction- a function to apply to the module's name and optional slot. Cannot benull. The slot value passed to the function may be null if the identifier does not contain one.canonicalize- iftruethe identifier will becanonicalizedbefore parsing- Returns:
- the value returned by
function
-
parseModuleIdentifier
public static <R> R parseModuleIdentifier(String moduleIdentifier, BiFunction<String, String, R> function, boolean canonicalize, String defaultSlot) Parses the given module identifier into name and optional slot elements, passing those to the given function and returning the result of that function.- Type Parameters:
R- the type returned byfunction- Parameters:
moduleIdentifier- an identifier for a module. Cannot benullfunction- a function to apply to the module's name and optional slot. Cannot benull. The slot value passed to the function may be null if the identifier does not contain one.canonicalize- iftruethe identifier will becanonicalizedbefore parsingdefaultSlot- string to pass tofunctionas the slot parameter if the identifier doesn't include a slot value. May benull- Returns:
- the value returned by
function
-
canonicalModuleIdentifier
Provides the canonical string representation of a module identifier from a base module name and an optional slot. The canonical representation will not include slot information if the slot ismain.- Parameters:
name- the base module name. Cannot benullslot- the module slot. May be @{code null}- Returns:
- the canonical representation. Will not return @{code null}
-