Interface ISlugGenerator
-
- All Implemented Interfaces:
public interface ISlugGeneratorStrategy interface for generating slugs from input strings.
Implementations of this interface define custom logic to convert a given input string (e.g., a title or name) into a URL-friendly slug.
This interface is intended to be used in conjunction with the EnableSlug annotation to plug in custom slug generation behavior within a Spring Boot application.
Example:
class CustomSlugGenerator : ISlugGenerator { override fun generate(input: String): String { return input.toLowerCase().replace("[^a-z0-9]+".toRegex(), "-").replace("^-|\$".toRegex(), "") } }