Package org.opennms.web.rest.support
Class CriteriaBehavior<T>
- java.lang.Object
-
- org.opennms.web.rest.support.CriteriaBehavior<T>
-
- Type Parameters:
T
-
- Direct Known Subclasses:
IpLikeCriteriaBehavior
,StringCriteriaBehavior
public class CriteriaBehavior<T> extends java.lang.Object
Specify a custom handler for a FIQL query term. This allows us to:
- Map the query term to a different criteria property name
- Specify a function to convert the String value to a specific Java type (Enum, Integer, etc.)
- Specify a function that will be executed when the search term is specified
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CriteriaBehavior.BeforeVisit
-
Constructor Summary
Constructors Constructor Description CriteriaBehavior(java.lang.String name, java.util.function.Function<java.lang.String,T> converter)
CriteriaBehavior(java.lang.String name, java.util.function.Function<java.lang.String,T> converter, CriteriaBehavior.BeforeVisit beforeVisit)
CriteriaBehavior(java.util.function.Function<java.lang.String,T> converter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeVisit(CriteriaBuilder builder, java.lang.Object value, org.apache.cxf.jaxrs.ext.search.ConditionType c, boolean isWildcard)
T
convert(java.lang.String value)
java.util.function.Function<java.lang.String,T>
getConverter()
java.lang.String
getPropertyName()
void
setSkipPropertyByDefault(boolean skip)
boolean
shouldSkipProperty(org.apache.cxf.jaxrs.ext.search.ConditionType condition, boolean wildcard)
java.lang.String
toString()
-
-
-
Constructor Detail
-
CriteriaBehavior
public CriteriaBehavior(java.util.function.Function<java.lang.String,T> converter)
-
CriteriaBehavior
public CriteriaBehavior(java.lang.String name, java.util.function.Function<java.lang.String,T> converter)
-
CriteriaBehavior
public CriteriaBehavior(java.lang.String name, java.util.function.Function<java.lang.String,T> converter, CriteriaBehavior.BeforeVisit beforeVisit)
-
-
Method Detail
-
getPropertyName
public java.lang.String getPropertyName()
-
getConverter
public java.util.function.Function<java.lang.String,T> getConverter()
-
beforeVisit
public void beforeVisit(CriteriaBuilder builder, java.lang.Object value, org.apache.cxf.jaxrs.ext.search.ConditionType c, boolean isWildcard)
-
convert
public T convert(java.lang.String value)
-
setSkipPropertyByDefault
public void setSkipPropertyByDefault(boolean skip)
-
shouldSkipProperty
public boolean shouldSkipProperty(org.apache.cxf.jaxrs.ext.search.ConditionType condition, boolean wildcard)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-