@Override public C.List<T> insert(int index, List<T> subList) throws IndexOutOfBoundsException { if (index == 0) { return C.list(subList).prepend(v); } else if (index == 1) { return C.list(subList).append(v); } throw new IndexOutOfBoundsException(); }
@Override public C.List<T> insert(int index, T... ta) throws IndexOutOfBoundsException { if (index == 0) { return C.listOf(ta).prepend(v); } else if (index == 1) { return C.listOf(ta).append(v); } throw new IndexOutOfBoundsException(); }
@Override public C.List<T> insert(int index, List<T> subList) throws IndexOutOfBoundsException { if (index == 0) { return C.list(subList).prepend(v); } else if (index == 1) { return C.list(subList).append(v); } throw new IndexOutOfBoundsException(); }
public List<KVStore> distinct(MorphiaQuery q, String field, String... fields) { List<Group> id = C.listOf(fields).prepend(field).map(new $.Transformer<String, Group>() { @Override public Group transform(String s) { return Group.grouping(s); } }); AggregationPipeline pipeline = ds().createAggregation(modelType()); if (null != q) { pipeline.match(q.morphiaQuery()); } Iterator<DistinctResult> result = pipeline.group(id).out(DistinctResult.class); List<KVStore> retList = C.newList(); while (result.hasNext()) { DistinctResult dr = result.next(); retList.add(new KVStore(dr._id)); } return retList; }
@Override public WhereComponent or(WhereComponent... otherWhereComponents) { return new GroupWhereComponent(LogicOperator.OR, C.newListOf(otherWhereComponents).prepend(this)); } }
@Override public C.List<T> insert(int index, T... ta) throws IndexOutOfBoundsException { if (index == 0) { return C.listOf(ta).prepend(v); } else if (index == 1) { return C.listOf(ta).append(v); } throw new IndexOutOfBoundsException(); }
@Override public WhereComponent and(WhereComponent... otherWhereComponents) { return new GroupWhereComponent(LogicOperator.AND, C.newListOf(otherWhereComponents).prepend(this)); }