Class ContextSearchRequest


  • public class ContextSearchRequest
    extends java.lang.Object
    Model class that defines all conditions that context needs to meet
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ContextSearchRequest createAlternative​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> newNeedle)
      Creates new request on basis of this one with other attributes needle.
      ContextSearchRequest createAlternative​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> newNeedle, ContextSearchRestriction restriction)
      Creates new request on basis of this one with other attributes needle.
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getAttributesNeedle()
      Map of possible attribute values, that needs to match context attribute for it to returned as a search result
      Config getContextStack()
      Configuration model, which contexts will be searched through
      ContextSearchRestriction getParentRestriction()
      Gets a restriction for searching parents.
      boolean isNotEmpty()
      Checks whether only not empty configurations are requested
      void setNotEmpty​(boolean notEmpty)
      Informs if only not empty configurations are requested
      • Methods inherited from class java.lang.Object

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

      • ContextSearchRequest

        public ContextSearchRequest​(Config contextStack,
                                    java.util.Map<java.lang.String,​java.util.List<java.lang.String>> attributesNeedle,
                                    ContextSearchRestriction restriction)
    • Method Detail

      • isNotEmpty

        public boolean isNotEmpty()
        Checks whether only not empty configurations are requested
        Returns:
        true if only not empty configurations should be returned by search
      • setNotEmpty

        public void setNotEmpty​(boolean notEmpty)
        Informs if only not empty configurations are requested
        Parameters:
        notEmpty - true if only not empty configurations should be returned by search
      • getContextStack

        public Config getContextStack()
        Configuration model, which contexts will be searched through
        Returns:
        configuration model
      • getAttributesNeedle

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getAttributesNeedle()
        Map of possible attribute values, that needs to match context attribute for it to returned as a search result
        Returns:
        map of attributes in form <name, list of possible values>
      • getParentRestriction

        public ContextSearchRestriction getParentRestriction()
        Gets a restriction for searching parents.

        Search process, if no exact match can be found, looks for any matching contexts for parent values of current attributes search needle. A restriction stops the process from looking for parents of specified attributes.

        Returns:
        parents search restriction
      • createAlternative

        public ContextSearchRequest createAlternative​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> newNeedle)
        Creates new request on basis of this one with other attributes needle.
        Parameters:
        newNeedle - new attributes needle
        Returns:
        new reequest
      • createAlternative

        public ContextSearchRequest createAlternative​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> newNeedle,
                                                      ContextSearchRestriction restriction)
        Creates new request on basis of this one with other attributes needle.
        Parameters:
        newNeedle - new attributes needle
        Returns:
        new request