Object SlugUtil
-
- All Implemented Interfaces:
public class SlugUtilUtility class for handling slug generation operations.
This class provides static methods for setting and getting a global ISlugGenerator and for generating slugs. The ISlugGenerator is used to transform input strings into slugs based on specific rules.
-
-
Method Summary
Modifier and Type Method Description final UnitsetGenerator(ISlugGenerator slugGenerator)Sets the ISlugGenerator to be used globally for slug generation. final ISlugGeneratorgetGenerator()Retrieves the currently set ISlugGenerator. final Stringgenerate(String input)Converts the input string into a slug using the globally set ISlugGenerator. -
-
Method Detail
-
setGenerator
final Unit setGenerator(ISlugGenerator slugGenerator)
Sets the ISlugGenerator to be used globally for slug generation.
- Parameters:
slugGenerator- The ISlugGenerator instance to set.
-
getGenerator
final ISlugGenerator getGenerator()
Retrieves the currently set ISlugGenerator.
- Returns:
The current ISlugGenerator.
-
generate
final String generate(String input)
Converts the input string into a slug using the globally set ISlugGenerator.
The generated slug will follow the rules defined by the ISlugGenerator implementation.
- Parameters:
input- The input string to be converted into a slug.- Returns:
The generated slug.
-
-
-
-