本文整理匯總了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);
}