Class WebQueryDecodePlugin.Builder

java.lang.Object
com.peterphi.std.guice.restclient.jaxb.webquery.plugin.WebQueryDecodePlugin.Builder
Enclosing interface:
WebQueryDecodePlugin

public static class WebQueryDecodePlugin.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • with

    • validate

      public WebQueryDecodePlugin.Builder validate(String key, Predicate<String> predicate)
      Add a validator to limit the values that may be provided by the user for a given key
      Parameters:
      key - the key to validate
      predicate - condition which must return true for all values for this key
      Returns:
      this builder instance for chaining
    • banTextQuery

      public WebQueryDecodePlugin.Builder banTextQuery()
      Indicates that WebQuery Text queries should be banned
      Returns:
      this builder instance for chaining
    • ban

      public WebQueryDecodePlugin.Builder ban(String... keys)
      Indicates that the provided set of keys may not be specified by the user. This can include control fields
      Parameters:
      keys - a list of keys to ban
      Returns:
      this builder instance for chaining
    • allowOnly

      public WebQueryDecodePlugin.Builder allowOnly(String... keys)
      Allow only the provided set of keys, and special keys. Generally it will also be necessary to ban text queries too using banTextQuery()
      Parameters:
      keys - the keys to be permitted (in addition, special _ keys will be permitted)
      Returns:
      this builder instance for chaining
    • allowOnlyStrict

      public WebQueryDecodePlugin.Builder allowOnlyStrict(String... keys)
      Allow only the provided set of keys. Any special keys must also be explicitly whitelisted
      Parameters:
      keys - the keys to be permitted
      Returns:
      this builder instance for chaining
    • build

      public WebQueryDecodePlugin build()