Interface ISlugGenerator

  • All Implemented Interfaces:

    
    public interface ISlugGenerator
    
                        

    Strategy 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(), "")
        }
    }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract String generate(String input) Generates a slug from the given input string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • generate

         abstract String generate(String input)

        Generates a slug from the given input string.

        Parameters:
        input - the original string (e.g.
        Returns:

        a URL-friendly slug