类 URIPreconditions

java.lang.Object
org.apache.pulsar.common.util.URIPreconditions

@ThreadSafe public class URIPreconditions extends Object
Static convenience URI checker.
  • 构造器详细资料

    • URIPreconditions

      public URIPreconditions()
  • 方法详细资料

    • checkURI

      public static void checkURI(@Nonnull String uri, @Nonnull Predicate<URI> predicate) throws IllegalArgumentException
      Check whether the given string is a legal URI and passes the user's check.
      参数:
      uri - URI String
      predicate - User defined rule
      抛出:
      IllegalArgumentException - Illegal URI or failed in the user's rules
    • checkURIIfPresent

      public static void checkURIIfPresent(@Nullable String uri, @Nonnull Predicate<URI> predicate) throws IllegalArgumentException
      Check whether the given string is a legal URI and passes the user's check.
      参数:
      uri - URI String
      predicate - User defined rule
      抛出:
      IllegalArgumentException - Illegal URI or failed in the user's rules
    • checkURIIfPresent

      public static void checkURIIfPresent(@Nullable String uri, @Nonnull Predicate<URI> predicate, @Nullable String errorMessage) throws IllegalArgumentException
      Check whether the given string is a legal URI and passes the user's check.
      参数:
      uri - URI String
      predicate - User defined rule
      errorMessage - Error message
      抛出:
      IllegalArgumentException - Illegal URI or failed in the user's rules
    • checkURI

      public static void checkURI(@Nonnull String uri, @Nonnull Predicate<URI> predicate, @Nullable String errorMessage) throws IllegalArgumentException
      Check whether the given string is a legal URI and passes the user's check.
      参数:
      uri - URI String
      predicate - User defined rule
      errorMessage - Error message
      抛出:
      IllegalArgumentException - Illegal URI or failed in the user's rules