@Test public void noContentAndFilter() { assertThat(whereClause("", true), is(equalTo("name LIKE :nameFilter"))); }
@Nullable public static String whereClause(@Nullable final String content, final boolean includeFilter, final boolean includeLastId) { List<String> clauses = Lists.newArrayList(); if (!Strings2.isBlank(content)) { clauses.add(content); } if (includeFilter) { clauses.add(P_NAME + " LIKE :nameFilter"); } if (includeLastId) { clauses.add("@rid > :rid"); } if (!clauses.isEmpty()) { return Joiner.on(" AND ").join(clauses); } else { return null; } }
AssetWhereClauseBuilder { @Nullable public static String whereClause(@Nullable final String content, final boolean includeFilter, final boolean includeLastId) { List<String> clauses = Lists.newArrayList(); if (!Strings2.isBlank(content)) { clauses.add(content); } if (includeFilter) { clauses.add(P_NAME + " LIKE :nameFilter"); } if (includeLastId) { clauses.add("@rid > :rid"); } if (!clauses.isEmpty()) { return Joiner.on(" AND ").join(clauses); } else { return null; } } }
AssetWhereClauseBuilder { @Nullable public static String whereClause(@Nullable final String content, final boolean includeFilter, final boolean includeLastId) { List<String> clauses = Lists.newArrayList(); if (!Strings2.isBlank(content)) { clauses.add(content); } if (includeFilter) { clauses.add(P_NAME + " LIKE :nameFilter"); } if (includeLastId) { clauses.add("@rid > :rid"); } if (!clauses.isEmpty()) { return Joiner.on(" AND ").join(clauses); } else { return null; } } private  AssetWhereClauseBuilder(); }
AssetWhereClauseBuilder { @Nullable public static String whereClause(@Nullable final String content, final boolean includeFilter, final boolean includeLastId) { List<String> clauses = Lists.newArrayList(); if (!Strings2.isBlank(content)) { clauses.add(content); } if (includeFilter) { clauses.add(P_NAME + " LIKE :nameFilter"); } if (includeLastId) { clauses.add("@rid > :rid"); } if (!clauses.isEmpty()) { return Joiner.on(" AND ").join(clauses); } else { return null; } } private  AssetWhereClauseBuilder(); @Nullable static String whereClause(@Nullable final String content, final boolean includeFilter,
                                   final boolean includeLastId); @Nullable static String whereClause(final String content, final boolean includeFilter); }
AssetWhereClauseBuilder { @Nullable public static String whereClause(@Nullable final String content, final boolean includeFilter, final boolean includeLastId) { List<String> clauses = Lists.newArrayList(); if (!Strings2.isBlank(content)) { clauses.add(content); } if (includeFilter) { clauses.add(P_NAME + " LIKE :nameFilter"); } if (includeLastId) { clauses.add("@rid > :rid"); } if (!clauses.isEmpty()) { return Joiner.on(" AND ").join(clauses); } else { return null; } } private  AssetWhereClauseBuilder(); @Nullable static String whereClause(@Nullable final String content, final boolean includeFilter,
                                   final boolean includeLastId); @Nullable static String whereClause(final String content, final boolean includeFilter);  }