Class WebQueryPresetPlugin

java.lang.Object
com.peterphi.std.guice.restclient.jaxb.webquery.plugin.WebQueryPresetPlugin
All Implemented Interfaces:
WebQueryDecodePlugin

public class WebQueryPresetPlugin extends Object implements WebQueryDecodePlugin
Simple WebQuery Decode Plugin that allows named presets for queries. Example usage:

new WebQueryPresetPlugin("preset")
                .withAllowMultiple(false) // Allow multiple presets to be specified in a single query
                .withFailIfUnsupported(true) // Throw an exception if an unsupported preset is used (the default)
                .withOption("running", q -> q.eq("state", "QUEUED", "RUNNING", "PAUSED"))
                .withOption("important", q -> q.ge("priority", "10"))
                .withOption("terminated", q -> q.eq("state", "FAILED", "SUCCESS", "CANCELLED"))