001
014
015 package com.liferay.portlet.dynamicdatamapping.storage.query;
016
017
020 public class ConditionFactoryImpl implements ConditionFactory {
021
022 @Override
023 public Junction conjunction() {
024 return new JunctionImpl(LogicalOperator.AND);
025 }
026
027 @Override
028 public Junction disjunction() {
029 return new JunctionImpl(LogicalOperator.OR);
030 }
031
032 @Override
033 public Condition eq(String name, Object value) {
034 return new FieldConditionImpl(name, value, ComparisonOperator.EQUALS);
035 }
036
037 @Override
038 public Condition gt(String name, Object value) {
039 return new FieldConditionImpl(
040 name, value, ComparisonOperator.GREATER_THAN);
041 }
042
043 @Override
044 public Condition gte(String name, Object value) {
045 return new FieldConditionImpl(
046 name, value, ComparisonOperator.GREATER_THAN_OR_EQUAL_TO);
047 }
048
049 @Override
050 public Condition in(String name, Object value) {
051 return new FieldConditionImpl(name, value, ComparisonOperator.IN);
052 }
053
054 @Override
055 public Condition like(String name, Object value) {
056 return new FieldConditionImpl(name, value, ComparisonOperator.LIKE);
057 }
058
059 @Override
060 public Condition lt(String name, Object value) {
061 return new FieldConditionImpl(
062 name, value, ComparisonOperator.LESS_THAN);
063 }
064
065 @Override
066 public Condition lte(String name, Object value) {
067 return new FieldConditionImpl(
068 name, value, ComparisonOperator.LESS_THAN_OR_EQUAL_TO);
069 }
070
071 @Override
072 public Condition ne(String name, Object value) {
073 return new FieldConditionImpl(
074 name, value, ComparisonOperator.NOT_EQUALS);
075 }
076
077 @Override
078 public Condition notIn(String name, Object value) {
079 return new FieldConditionImpl(name, value, ComparisonOperator.NOT_IN);
080 }
081
082 }