本文整理了Java中com.google.api.ads.admanager.lib.utils.QueryBuilder.removeKeyword
方法的一些代码示例,展示了QueryBuilder.removeKeyword
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryBuilder.removeKeyword
方法的具体详情如下:
包路径:com.google.api.ads.admanager.lib.utils.QueryBuilder
类名称:QueryBuilder
方法名:removeKeyword
[英]Removes the keyword from the clause if present. Will remove keyword + " ".
[中]从子句中删除关键字(如果存在)。将删除关键字+“”。
代码示例来源:origin: googleads/googleads-java-lib
/**
* Sets the statement FROM clause in the form of "table".
* Only necessary for statements being sent to the
* {@code PublisherQueryLanguageService}. The "FROM " keyword will be
* ignored.
*
* @param table the statement from clause without "FROM"
* @return a reference to this object
*/
@Override
public QueryBuilder<V> from(String table) {
Preconditions.checkNotNull(table, "FROM clause cannot be null");
table = removeKeyword(table, FROM);
this.from = table;
return this;
}
代码示例来源:origin: com.google.api-ads/ads-lib
/**
* Sets the statement WHERE clause in the form of<br><br>
* <code>"WHERE <condition> {[AND | OR] <condition> ...}"</code>
* <br><br>
* e.g. "a = b OR b = c". The "WHERE " keyword will be ignored.
* @param conditions the statement query without "WHERE"
* @return a reference to this object
*/
@Override
public QueryBuilder<V> where(String conditions) {
Preconditions.checkNotNull(conditions, "WHERE clause cannot be null");
conditions = removeKeyword(conditions, WHERE);
this.where = conditions;
return this;
}
代码示例来源:origin: googleads/googleads-java-lib
/**
* Sets the statement SELECT clause in the form of "a,b" or "*".
* Only necessary for statements being sent to the
* {@code PublisherQueryLanguageService}. The "SELECT " keyword will be
* ignored.
*
* @param columns the statement select clause without "SELECT"
* @return a reference to this object
*/
@Override
public QueryBuilder<V> select(String columns) {
Preconditions.checkNotNull(columns, "SELECT clause cannot be null");
columns = removeKeyword(columns, SELECT);
this.select = columns;
return this;
}
代码示例来源:origin: com.google.api-ads/ads-lib
/**
* Sets the statement SELECT clause in the form of "a,b" or "*".
* Only necessary for statements being sent to the
* {@code PublisherQueryLanguageService}. The "SELECT " keyword will be
* ignored.
*
* @param columns the statement select clause without "SELECT"
* @return a reference to this object
*/
@Override
public QueryBuilder<V> select(String columns) {
Preconditions.checkNotNull(columns, "SELECT clause cannot be null");
columns = removeKeyword(columns, SELECT);
this.select = columns;
return this;
}
代码示例来源:origin: com.google.api-ads/ads-lib
/**
* Sets the statement FROM clause in the form of "table".
* Only necessary for statements being sent to the
* {@code PublisherQueryLanguageService}. The "FROM " keyword will be
* ignored.
*
* @param table the statement from clause without "FROM"
* @return a reference to this object
*/
@Override
public QueryBuilder<V> from(String table) {
Preconditions.checkNotNull(table, "FROM clause cannot be null");
table = removeKeyword(table, FROM);
this.from = table;
return this;
}
代码示例来源:origin: googleads/googleads-java-lib
/**
* Sets the statement WHERE clause in the form of<br><br>
* <code>"WHERE <condition> {[AND | OR] <condition> ...}"</code>
* <br><br>
* e.g. "a = b OR b = c". The "WHERE " keyword will be ignored.
* @param conditions the statement query without "WHERE"
* @return a reference to this object
*/
@Override
public QueryBuilder<V> where(String conditions) {
Preconditions.checkNotNull(conditions, "WHERE clause cannot be null");
conditions = removeKeyword(conditions, WHERE);
this.where = conditions;
return this;
}
代码示例来源:origin: com.google.api-ads/ads-lib
/**
* Sets the statement ORDER BY clause in the form of<br><br>
* <code>"ORDER BY <property> [ASC | DESC]"</code>
* <br><br>
* e.g. "type ASC, lastModifiedDateTime DESC". The "ORDER BY " keyword will be
* ignored.
* @param orderBy the statement order by without "ORDER BY"
* @return a reference to this object
*/
@Override
public QueryBuilder<V> orderBy(String orderBy) {
Preconditions.checkNotNull(orderBy, "ORDER BY clause cannot be null");
orderBy = removeKeyword(orderBy, ORDER_BY);
this.orderBy = orderBy;
return this;
}
代码示例来源:origin: googleads/googleads-java-lib
/**
* Sets the statement ORDER BY clause in the form of<br><br>
* <code>"ORDER BY <property> [ASC | DESC]"</code>
* <br><br>
* e.g. "type ASC, lastModifiedDateTime DESC". The "ORDER BY " keyword will be
* ignored.
* @param orderBy the statement order by without "ORDER BY"
* @return a reference to this object
*/
@Override
public QueryBuilder<V> orderBy(String orderBy) {
Preconditions.checkNotNull(orderBy, "ORDER BY clause cannot be null");
orderBy = removeKeyword(orderBy, ORDER_BY);
this.orderBy = orderBy;
return this;
}
代码示例来源:origin: googleads/googleads-java-lib
@Test
public void testRemoveKeyword_matches() {
assertEquals("table", QueryBuilder.removeKeyword("FROM table", "FROM"));
assertEquals("table", QueryBuilder.removeKeyword("from table", "FROM"));
assertEquals("table", QueryBuilder.removeKeyword("fRom table", "FROM"));
assertEquals("", QueryBuilder.removeKeyword("FROM ", "FROM"));
assertEquals(" ", QueryBuilder.removeKeyword("FROM ", "FROM"));
}
代码示例来源:origin: googleads/googleads-java-lib
@Test
public void testRemoveKeyword_doesntMatch() {
assertEquals("FROM table", QueryBuilder.removeKeyword("FROM table", "SELECT"));
assertEquals("table", QueryBuilder.removeKeyword("table", "FROM"));
}
内容来源于网络,如有侵权,请联系作者删除!