org.nuiton.wikitty.search
Class RestrictionHelper
java.lang.Object
org.nuiton.wikitty.search.RestrictionHelper
public class RestrictionHelper
- extends Object
- Author:
- "Nicolas Chapurlat"
This class allow you to simply create restriction.
Examples :
RestrictionHelper.and(
RestrictionHelper.eq(
new ElementDto(ElementName.CONTENT_DEFINITION, OperandName.ID, OperandType.ID), "myContentDefId"),
RestrictionHelper.between(
new ElementDto(ElementName.CONTENT, OperandName.CREATION_DATE, OperandType.DATE),
RestrictionHelper.DATE_FORMAT.format (new Date(2008,1,25)),
RestrictionHelper.DATE_FORMAT.format (new Date(2008,6,15))))
);
example 2 : I search all content witch content definition id is
"myContentDefId" and attribute def 'ref' witch id is ATT_REF_ID is not equals
to "REF1234567890"
RestrictionHelper.and(
RestrictionHelper.eq(
new ElementDto(ElementName.CONTENT_DEFINITION, OperandName.ID, OperandType.ID), "myContentDefId"),
RestrictionHelper.neq(
new ElementDto(ElementName.ATTRIBUTE, "ATT_REF_ID", OperandType.STRING), "REF1234567890"))
);
|
Method Summary |
static And |
and(List<Restriction> restrictions)
|
static Restriction |
and(Restriction restriction1,
Restriction restriction2,
Restriction... otherRestrictions)
|
static Restriction |
between(Element element,
String min,
String max)
|
static Restriction |
contains(Element element,
List<String> values)
|
static Restriction |
contains(Element element,
String value1,
String... otherValues)
|
static Restriction |
end(Element element,
String value)
|
static Restriction |
eq(Element element,
String value)
|
static SimpleDateFormat |
getDateFormat()
|
static Restriction |
great(Element element,
String value)
|
static Restriction |
greatEq(Element element,
String value)
|
static Restriction |
in(Element element,
List<String> values)
|
static Restriction |
in(Element element,
String value1,
String... otherValues)
|
static Null |
isNotNull(String fieldName)
|
static Null |
isNull(String fieldName)
|
static Keyword |
keyword(String value)
|
static Restriction |
less(Element element,
String value)
|
static Restriction |
lessEq(Element element,
String value)
|
static Restriction |
like(Element element,
String value,
Like.SearchAs searchAs)
|
static Restriction |
neq(Element element,
String value)
|
static Restriction |
not(Restriction restriction)
|
static Or |
or(List<Restriction> restrictions)
|
static Or |
or(Restriction restriction1,
Restriction restriction2,
Restriction... otherRestrictions)
|
static False |
rFalse()
|
static True |
rTrue()
|
static Restriction |
start(Element element,
String value)
|
static Restriction |
unlike(Element element,
String value,
Like.SearchAs searchAs)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RestrictionHelper
public RestrictionHelper()
eq
public static Restriction eq(Element element,
String value)
neq
public static Restriction neq(Element element,
String value)
less
public static Restriction less(Element element,
String value)
lessEq
public static Restriction lessEq(Element element,
String value)
great
public static Restriction great(Element element,
String value)
greatEq
public static Restriction greatEq(Element element,
String value)
start
public static Restriction start(Element element,
String value)
end
public static Restriction end(Element element,
String value)
between
public static Restriction between(Element element,
String min,
String max)
contains
public static Restriction contains(Element element,
String value1,
String... otherValues)
contains
public static Restriction contains(Element element,
List<String> values)
in
public static Restriction in(Element element,
String value1,
String... otherValues)
in
public static Restriction in(Element element,
List<String> values)
not
public static Restriction not(Restriction restriction)
and
public static Restriction and(Restriction restriction1,
Restriction restriction2,
Restriction... otherRestrictions)
and
public static And and(List<Restriction> restrictions)
or
public static Or or(Restriction restriction1,
Restriction restriction2,
Restriction... otherRestrictions)
or
public static Or or(List<Restriction> restrictions)
rTrue
public static True rTrue()
rFalse
public static False rFalse()
keyword
public static Keyword keyword(String value)
isNull
public static Null isNull(String fieldName)
isNotNull
public static Null isNotNull(String fieldName)
like
public static Restriction like(Element element,
String value,
Like.SearchAs searchAs)
unlike
public static Restriction unlike(Element element,
String value,
Like.SearchAs searchAs)
getDateFormat
public static SimpleDateFormat getDateFormat()
Copyright © 2009-2011 CodeLutin. All Rights Reserved.