Interface RouteBuilder.UriNamingStrategy

All Known Implementing Classes:
ConfigurableUriNamingStrategy, HyphenatedUriNamingStrategy
Enclosing interface:
RouteBuilder

public static interface RouteBuilder.UriNamingStrategy

A URI naming strategy is used to dictate the default name to use when building a URI for a class.

The default strategy is as follows:

Implementers can override to provide other strategies such as pluralization etc.

  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    normalizeUri(@Nullable String uri)
    Normalizes a URI.
    default @NonNull String
    resolveUri(io.micronaut.inject.BeanDefinition<?> beanDefinition)
    Resolve the URI to use for the given type.
    default String
    resolveUri(Class<?> type)
    Resolve the URI to use for the given type.
    default @NonNull String
    resolveUri(Class<?> type, io.micronaut.core.naming.conventions.PropertyConvention id)
    Resolve the URI to use for the given type and route id.
    default @NonNull String
    resolveUri(String property)
    Resolve the URI to use for the given type.
  • Method Details

    • resolveUri

      default String resolveUri(Class<?> type)
      Resolve the URI to use for the given type.
      Parameters:
      type - The type
      Returns:
      The URI to use
    • resolveUri

      @NonNull default @NonNull String resolveUri(io.micronaut.inject.BeanDefinition<?> beanDefinition)
      Resolve the URI to use for the given type.
      Parameters:
      beanDefinition - The type
      Returns:
      The URI to use
    • resolveUri

      @NonNull default @NonNull String resolveUri(String property)
      Resolve the URI to use for the given type.
      Parameters:
      property - The property
      Returns:
      The URI to use
    • resolveUri

      @NonNull default @NonNull String resolveUri(Class<?> type, io.micronaut.core.naming.conventions.PropertyConvention id)
      Resolve the URI to use for the given type and route id.
      Parameters:
      type - The type
      id - the route id
      Returns:
      The URI to use
    • normalizeUri

      default String normalizeUri(@Nullable @Nullable String uri)
      Normalizes a URI.

      Ensures the string: 1) Does not end with a / 2) Starts with a /

      Parameters:
      uri - The URI
      Returns:
      The normalized URI or null