Class Parameters

  • All Implemented Interfaces:
    java.io.Serializable

    public class Parameters
    extends java.lang.Object
    implements java.io.Serializable
    container object for QueryParameter and Filter instances. The public Strings available here are used throughout this class and should also be used in query strings as named parameters. For example, the field ID has the value "id", and a query which would like to use the addId(Long) method, should define a named parameter of the form ":id".
    Since:
    3.0-M2
    See Also:
    Serialized Form
    • Field Detail

      • ID

        public static final java.lang.String ID
        named parameter "id". Used in query strings as ":id"
        See Also:
        Constant Field Values
      • IDS

        public static final java.lang.String IDS
        named parameter "ids". Used in query strings as ":ids"
        See Also:
        Constant Field Values
      • CLASS

        public static final java.lang.String CLASS
        named parameter "class". Used in query strings as ":class"
        See Also:
        Constant Field Values
      • ALGORITHM

        public static final java.lang.String ALGORITHM
        named parameter "algorithm". Used in query strings as ":algorithm"
        See Also:
        Constant Field Values
      • OWNER_ID

        public static final java.lang.String OWNER_ID
        named parameter "ownerId". Used in query strings as ":ownerId"
        See Also:
        Constant Field Values
      • GROUP_ID

        public static final java.lang.String GROUP_ID
        named parameter "groupId". Used in query strings as ":groupId"
        See Also:
        Constant Field Values
    • Constructor Detail

      • Parameters

        public Parameters()
        default constructor. Filter is left null. queryParameters collection is initialized to empty Collection
      • Parameters

        public Parameters​(Filter filter)
        Filter constructor. Allows for the simple specification of "unique" results. new Parameters( new Filter().unique() ); Filter can be null since this is the default behavior anyway.
    • Method Detail

      • queryParameters

        public QueryParameter[] queryParameters()
        copies all QueryParameters to an array. Changes to this array do not effect the internal QueryParameters.
        Returns:
        array of QueryParameter.
      • get

        public QueryParameter get​(java.lang.String name)
        lookup a QueryParameter by name.
      • keySet

        public java.util.Set<java.lang.String> keySet()
        the Set of all names which would would return a non-null value from get(String)
        Returns:
        a Set of Strings.
      • addAll

        public Parameters addAll​(Parameters old)
        adds all the information from the passed in Parameters instance to this instance. All QueryParameters are added, and the Filter instance is added if the current
        Parameters:
        old - Non-null Parameters instance.
        Returns:
        this
      • addAll

        public Parameters addAll​(QueryParameter[] queryParameters)
        adds all the information from the passed in Parameters instance to this instance. All QueryParameters are added, and the Filter instance is added if the current
        Parameters:
        queryParameters - Non-null array of QueryParameters.
        Returns:
        this
      • addClass

        public Parameters addClass​(java.lang.Class klass)
      • addClass

        public Parameters addClass​(java.lang.String name,
                                   java.lang.Class value)
      • addBoolean

        public Parameters addBoolean​(java.lang.String name,
                                     java.lang.Boolean value)
      • addInteger

        public Parameters addInteger​(java.lang.String name,
                                     java.lang.Integer value)
      • addLong

        public Parameters addLong​(java.lang.String name,
                                  java.lang.Long value)
      • addSet

        public Parameters addSet​(java.lang.String name,
                                 java.util.Set value)
      • addList

        public Parameters addList​(java.lang.String name,
                                  java.util.List value)
      • addMap

        public Parameters addMap​(java.lang.String name,
                                 java.util.Map value)
      • addString

        public Parameters addString​(java.lang.String name,
                                    java.lang.String value)
      • addId

        public Parameters addId​(java.lang.Long id)
      • addIds

        public Parameters addIds​(java.util.Collection ids)
      • addAlgorithm

        public Parameters addAlgorithm​(java.lang.String algo)
      • owner

        public long owner()
      • isExperimenter

        public boolean isExperimenter()
      • getExperimenter

        public java.lang.Long getExperimenter()
        Fulfills the old PojoOptions requirement for returning null if no owner set.
      • group

        public long group()
      • getGroup

        public java.lang.Long getGroup()
        Fulfills the old PojoOptions requirement for returning null if no owner set.
      • isGroup

        public boolean isGroup()
      • startTime

        public Parameters startTime​(java.sql.Timestamp timestamp)
      • getStartTime

        public java.sql.Timestamp getStartTime()
      • endTime

        public Parameters endTime​(java.sql.Timestamp timestamp)
      • getEndTime

        public java.sql.Timestamp getEndTime()
      • paginate

        public Parameters paginate​(java.lang.Integer offset,
                                   java.lang.Integer limit)
      • getLimit

        public java.lang.Integer getLimit()
      • getOffset

        public java.lang.Integer getOffset()
      • isPagination

        public boolean isPagination()
      • page

        public Parameters page​(java.lang.Integer offset,
                               java.lang.Integer limit)
      • isUnique

        public boolean isUnique()
      • isAcquisitionData

        public boolean isAcquisitionData()
      • isLeaves

        public boolean isLeaves()
      • isOrphan

        public boolean isOrphan()
      • cache

        public Parameters cache()
        Deprecated.
        experimental: may be wholly removed in next major version
        Set queries to be cacheable. Use with caution.
        Returns:
        this instance, for method chaining
      • noCache

        public Parameters noCache()
        Set queries to not be cacheable. This is the default.
        Returns:
        this instance, for method chaining
      • isCache

        public boolean isCache()
        Returns:
        if queries are cacheable
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object