Package org.forgerock.api.util
Class PathUtil
java.lang.Object
org.forgerock.api.util.PathUtil
Utilities for working with API Description paths and path-parameters.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Builds a forward-slash-delimited path, with duplicate forward-slashes removed, and trailing slashes removed.static Parameter[]
buildPathParameters
(String pathSegment) Searches for curly-braces in the givenpathSegment
, and creates a path-parameter for each that are found.mergeParameters
(List<Parameter> parameterList, Parameter... parameters) MergesParameter
values into the givenparameterList
, where conflictingparameter-names
will be replaced, and new parameters will otherwise be added.
-
Method Details
-
buildPath
Builds a forward-slash-delimited path, with duplicate forward-slashes removed, and trailing slashes removed.- Parameters:
segment
- First path segmentmoreSegments
- Additional path segments ornull
- Returns:
- Path
-
buildPathParameters
Searches for curly-braces in the givenpathSegment
, and creates a path-parameter for each that are found.- Parameters:
pathSegment
- Path-segment- Returns:
- Path-parameters or
null
-
mergeParameters
public static List<Parameter> mergeParameters(List<Parameter> parameterList, Parameter... parameters) MergesParameter
values into the givenparameterList
, where conflictingparameter-names
will be replaced, and new parameters will otherwise be added.- Parameters:
parameterList
- Current list of parametersparameters
- Additional parameters to merge ornull
- Returns:
parameterList
field
-