Object TenantedUrl.Companion

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Boolean isTenanted(String url) Quick check if a url is tenanted
      final TenantedUrl of(Integer tenantId, String url)
      final TenantedUrl split(String url) construct a new TenantedUrl from a url : tenant id and normal url, if the url is not tenanted, returned tenant id is 0
      final String combine(Integer tenantId, String untenantedUrl) Combine tenantId and untenantedUrl to a tenanted url representationZero tenant id means no tenant, so return the original untenantedUrl
      final String stripTenant(String url) Get url part of tenantedUrl, if it has a tenant id, strip the tenant id, otherwise,
      final Character getTENANT_ID_SEPERATOR()
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • isTenanted

         final Boolean isTenanted(String url)

        Quick check if a url is tenanted

        Parameters:
        url - the url
        Returns:

        if the url start with a digit number, returns true

      • split

         final TenantedUrl split(String url)

        construct a new TenantedUrl from a url : tenant id and normal url, if the url is not tenanted, returned tenant id is 0

      • combine

         final String combine(Integer tenantId, String untenantedUrl)

        Combine tenantId and untenantedUrl to a tenanted url representation

        Zero tenant id means no tenant, so return the original untenantedUrl

        Parameters:
        untenantedUrl - the untenanted url, the caller should ensure it's not tenanted
        Returns:

        the tenanted url of untenantedUrl

      • stripTenant

         final String stripTenant(String url)

        Get url part of tenantedUrl, if it has a tenant id, strip the tenant id, otherwise,

        Returns:

        the url part of a tenantedUrl