com.google.api.ads.admanager.lib.utils.QueryBuilder.removeKeyword()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(57)

本文整理了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

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 &lt;condition&gt; {[AND | OR] &lt;condition&gt; ...}"</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 &lt;condition&gt; {[AND | OR] &lt;condition&gt; ...}"</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 &lt;property&gt; [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 &lt;property&gt; [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"));
}

相关文章

微信公众号

最新文章

更多