/** * Create a new List typed path * * @param <A> * @param property property name * @param type property type * @return property path */ public <A> ListPath<A, PathBuilder<A>> getList(String property, Class<A> type) { return this.<A, PathBuilder<A>>getList(property, type, PathBuilder.class); }
@Test public void various() { PathBuilder<User> entity = new PathBuilder<User>(User.class, "entity"); entity.getBoolean("boolean"); entity.getCollection("col", User.class); entity.getComparable("comparable", Comparable.class); entity.getDate("date", Date.class); entity.getDateTime("dateTime", Date.class); entity.getList("list", User.class); entity.getMap("map", String.class, User.class); entity.getNumber("number", Integer.class); entity.getSet("set", User.class); entity.getSimple("simple", Object.class); entity.getString("string"); entity.getTime("time", Time.class); }
@Test public void test() { DummySerializer serializer = new DummySerializer(new JavaTemplates()); StringPath strPath = Expressions.stringPath("str"); // path serializer.handle(strPath); // operation serializer.handle(strPath.isNotNull()); // long path serializer.handle(new PathBuilder<Object>(Object.class,"p").getList("l",Map.class).get(0)); // constant serializer.handle(ConstantImpl.create("")); // custom serializer.handle(ExpressionUtils.template(Object.class, "xxx", ConstantImpl.create(""))); }
/** * Create a new List typed path * * @param <A> * @param property property name * @param type property type * @return property path */ public <A> ListPath<A, PathBuilder<A>> getList(String property, Class<A> type) { return this.<A, PathBuilder<A>>getList(property, type, PathBuilder.class); }