本文整理汇总了Java中org.kuali.rice.core.api.criteria.CriteriaValue类的典型用法代码示例。如果您正苦于以下问题:Java CriteriaValue类的具体用法?Java CriteriaValue怎么用?Java CriteriaValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CriteriaValue类属于org.kuali.rice.core.api.criteria包,在下文中一共展示了CriteriaValue类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVal
import org.kuali.rice.core.api.criteria.CriteriaValue; //导入依赖的package包/类
/**
* Converts any {@link DateTime} values to {@link Timestamp}s.
*
* @param toConv the {@link CriteriaValue} to convert.
* @param <U> the type of the {@link CriteriaValue}.
* @return the {@link CriteriaValue} converted.
*/
protected static <U extends CriteriaValue<?>> Object getVal(U toConv) {
Object o = toConv.getValue();
if (o instanceof DateTime) {
return new Timestamp(((DateTime) o).getMillis());
}
return o;
}
示例2: getVals
import org.kuali.rice.core.api.criteria.CriteriaValue; //导入依赖的package包/类
/**
* Converts a set of {@link CriteriaValue}s to an undefined type.
*
* @param toConv the {@link CriteriaValue} to convert.
* @return a set of {@link CriteriaValue}s as an undefined type.
*/
protected static Set<?> getVals(Set<? extends CriteriaValue<?>> toConv) {
final Set<Object> values = new HashSet<Object>();
for (CriteriaValue<?> value : toConv) {
values.add(getVal(value));
}
return values;
}
示例3: getVal
import org.kuali.rice.core.api.criteria.CriteriaValue; //导入依赖的package包/类
private static <U extends CriteriaValue<?>> Object getVal(U toConv) {
Object o = toConv.getValue();
if (o instanceof DateTime) {
return new Timestamp(((DateTime) o).getMillis());
}
return o;
}
示例4: getVals
import org.kuali.rice.core.api.criteria.CriteriaValue; //导入依赖的package包/类
private static Set<?> getVals(Set<? extends CriteriaValue<?>> toConv) {
final Set<Object> values = new HashSet<Object>();
for (CriteriaValue<?> value : toConv) {
values.add(getVal(value));
}
return values;
}
示例5: applyPredicate
import org.kuali.rice.core.api.criteria.CriteriaValue; //导入依赖的package包/类
private Predicate applyPredicate(final Predicate input) {
if (input instanceof PropertyPathPredicate) {
String pp = ((PropertyPathPredicate) input).getPropertyPath();
if (isAttributesPredicate(pp)) {
final String attributeName = pp.substring(pp.indexOf('[') + 1, pp.indexOf(']'));
final Predicate attrValue;
if (input instanceof SingleValuedPredicate) {
final CriteriaValue<?> value = ((SingleValuedPredicate) input).getValue();
attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE, value.getValue());
} else if (input instanceof MultiValuedPredicate) {
final Set<? extends CriteriaValue<?>> values = ((MultiValuedPredicate) input).getValues();
List<Object> l = new ArrayList<Object>();
for (CriteriaValue<?> v : values) {
l.add(v.getValue());
}
attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE, l.toArray());
} else {
attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE);
}
return and(equal(ATTRIBUTE_DETAILS_ATTRIBUTE_NAME, attributeName), attrValue);
}
} else if (input instanceof CompositePredicate) {
return applyCompositePredicate((CompositePredicate) input);
}
return input;
}
示例6: apply
import org.kuali.rice.core.api.criteria.CriteriaValue; //导入依赖的package包/类
@Override
public Predicate apply(final Predicate input) {
if (input instanceof PropertyPathPredicate) {
String pp = ((PropertyPathPredicate) input).getPropertyPath();
if (isAttributesPredicate(pp)) {
final String attributeName = pp.substring(pp.indexOf('[') + 1, pp.indexOf(']'));
final Predicate attrValue;
if (input instanceof SingleValuedPredicate) {
final CriteriaValue<?> value = ((SingleValuedPredicate) input).getValue();
attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE, value.getValue());
} else if (input instanceof MultiValuedPredicate) {
final Set<? extends CriteriaValue<?>> values = ((MultiValuedPredicate) input).getValues();
List<Object> l = new ArrayList<Object>();
for (CriteriaValue<?> v : values) {
l.add(v.getValue());
}
attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE, l.toArray());
} else {
attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE);
}
return and(equal(ATTRIBUTE_DETAILS_ATTRIBUTE_NAME, attributeName), attrValue);
}
}
return input;
}
示例7: getValsUnsafe
import org.kuali.rice.core.api.criteria.CriteriaValue; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static <T, U extends CriteriaValue<T>> Set<T> getValsUnsafe(Set<? extends U> toConv) {
return (Set<T>) getVals(toConv);
}
示例8: getValsUnsafe
import org.kuali.rice.core.api.criteria.CriteriaValue; //导入依赖的package包/类
/**
* Converts a set of {@link CriteriaValue}s.
*
* <p>This is unsafe because values could be converted resulting in a class cast exception.</p>
*
* @param toConv the {@link CriteriaValue} to convert.
* @param <U> the initial type of the {@link CriteriaValue} set.
* @param <T> the final type of the {@link CriteriaValue} set.
* @return the {@link CriteriaValue} set converted.
*/
@SuppressWarnings("unchecked")
protected static <T, U extends CriteriaValue<T>> Set<T> getValsUnsafe(Set<? extends U> toConv) {
return (Set<T>) getVals(toConv);
}