示例#1
0
  public static <T extends IEntity> Specification<T> resolveConstraint(
      final Triple<String, ClientOperation, String> constraint, final Class<T> clazz) {
    final String constraintName = constraint.getLeft();
    final boolean negated = isConstraintNegated(constraint);

    if (constraintName.equals(QueryConstants.NAME)) {
      return QuerySpecificationSec.getByNameSpecification(
          clazz, constraint.getMiddle(), constraint.getRight(), negated);
    }
    if (constraintName.equals(QueryConstants.ID)) {
      return QuerySpecificationSec.getByIdSpecification(
          clazz, Long.parseLong(constraint.getRight()), negated);
    }
    return null;
  }
示例#2
0
 public void setAnimation(
     Triple<Integer, Integer, Float> animData, Table<Integer, Optional<Node<?>>, Key> keyData) {
   ImmutableTable.Builder<Integer, Node<?>, Key> builder = ImmutableTable.builder();
   for (Table.Cell<Integer, Optional<Node<?>>, Key> key : keyData.cellSet()) {
     builder.put(key.getRowKey(), key.getColumnKey().or(this), key.getValue());
   }
   setAnimation(
       new Animation(
           animData.getLeft(), animData.getMiddle(), animData.getRight(), builder.build()));
 }