Package org.forgerock.api.util
Class PathUtil
- java.lang.Object
-
- org.forgerock.api.util.PathUtil
-
public final class PathUtil extends Object
Utilities for working with API Description paths and path-parameters.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringbuildPath(String segment, String... moreSegments)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.static List<Parameter>mergeParameters(List<Parameter> parameterList, Parameter... parameters)MergesParametervalues into the givenparameterList, where conflictingparameter-nameswill be replaced, and new parameters will otherwise be added.
-
-
-
Method Detail
-
buildPath
public static String buildPath(String segment, String... moreSegments)
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
public static Parameter[] buildPathParameters(String pathSegment)
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)
MergesParametervalues into the givenparameterList, where conflictingparameter-nameswill be replaced, and new parameters will otherwise be added.- Parameters:
parameterList- Current list of parametersparameters- Additional parameters to merge ornull- Returns:
parameterListfield
-
-