Class PrimitiveSearchCondition<T>

    • Constructor Detail

      • PrimitiveSearchCondition

        public PrimitiveSearchCondition​(String propertyName,
                                        Object propertyValue,
                                        ConditionType ct,
                                        T condition)
      • PrimitiveSearchCondition

        public PrimitiveSearchCondition​(String propertyName,
                                        Object propertyValue,
                                        Type propertyType,
                                        ConditionType ct,
                                        T condition)
    • Method Detail

      • findAll

        public List<T> findAll​(Collection<T> pojos)
        Description copied from interface: SearchCondition
        Returns a list of pojos matching the condition
        Specified by:
        findAll in interface SearchCondition<T>
        Parameters:
        pojos - list of pojos
        Returns:
        list of the matching pojos or null if none have been found
      • getCondition

        public T getCondition()
        Description copied from interface: SearchCondition
        Some SearchConditions may use instance of T to capture the actual search criteria thus making it simpler to implement isMet(T). In some cases, the code which is given SearchCondition may find it more efficient to directly deal with the captured state for a more efficient lookup of matching data/records as opposed to calling SearchCondition.isMet for every instance of T it knows about.
        Specified by:
        getCondition in interface SearchCondition<T>
        Returns:
        T the captured search criteria, can be null
      • getPropertyName

        protected String getPropertyName()
      • getPropertyValue

        protected Object getPropertyValue()
      • getPropertyType

        protected Type getPropertyType()
      • getSearchConditions

        public List<SearchCondition<T>> getSearchConditions()
        Description copied from interface: SearchCondition
        List of conditions this SearchCondition may represent. Composite SearchConditions will return a list of conditions they are composed from, primitive ones will return null
        Specified by:
        getSearchConditions in interface SearchCondition<T>
        Returns:
        list of conditions, can be null
      • getStatement

        public PrimitiveStatement getStatement()
        Description copied from interface: SearchCondition
        Primitive statement such a > b, i < 5, etc this condition may represent. Complex conditions will return null.
        Specified by:
        getStatement in interface SearchCondition<T>
        Returns:
        primitive search statement, can be null
      • isMet

        public boolean isMet​(T pojo)
        Description copied from interface: SearchCondition
        Checks if the given pojo instance meets this search condition
        Specified by:
        isMet in interface SearchCondition<T>
        Parameters:
        pojo - the object which will be checked
        Returns:
        true if the pojo meets this search condition, false - otherwise
      • accept

        public void accept​(SearchConditionVisitor<T,​?> visitor)
        Description copied from interface: SearchCondition
        Provides a visitor which will convert this SearchCondition into a custom expression, for example, into the SQL statement, etc
        Specified by:
        accept in interface SearchCondition<T>
      • getPrimitiveValue

        protected static Object getPrimitiveValue​(String name,
                                                  Object value)