當前位置: 首頁>>代碼示例>>Java>>正文


Java BidRequest.Builder方法代碼示例

本文整理匯總了Java中com.google.openrtb.OpenRtb.BidRequest.Builder方法的典型用法代碼示例。如果您正苦於以下問題:Java BidRequest.Builder方法的具體用法?Java BidRequest.Builder怎麽用?Java BidRequest.Builder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.openrtb.OpenRtb.BidRequest的用法示例。


在下文中一共展示了BidRequest.Builder方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readBidRequestField

import com.google.openrtb.OpenRtb.BidRequest; //導入方法依賴的package包/類
@Override protected void readBidRequestField(
    JsonParser par, BidRequest.Builder req, String fieldName)
    throws IOException {
  switch (fieldName) {
    case "crtype": {
      req.setExtension(TestExt.crtype, par.getText());
      break;
    }

    default:
      super.readBidRequestField(par, req, fieldName);
  }
}
 
開發者ID:google,項目名稱:openrtb,代碼行數:14,代碼來源:OpenRtbExtJsonTest.java

示例2: testUpdate

import com.google.openrtb.OpenRtb.BidRequest; //導入方法依賴的package包/類
@Test
public void testUpdate() {
  BidRequest.Builder req = BidRequest.newBuilder().setId("0");
  ProtoUtils.update(ImmutableList.of(req), reqBuilder -> {
    reqBuilder.setAt(AuctionType.FIRST_PRICE);
    return true;
  });
  assertThat(req.getAt()).isSameAs(AuctionType.FIRST_PRICE);
}
 
開發者ID:google,項目名稱:openrtb,代碼行數:10,代碼來源:ProtoUtilsTest.java

示例3: testBuilderConversions

import com.google.openrtb.OpenRtb.BidRequest; //導入方法依賴的package包/類
@Test
public void testBuilderConversions() {
  BidRequest.Builder reqBuilder = BidRequest.newBuilder().setId("0");
  BidRequest req = reqBuilder.build();
  assertThat(ProtoUtils.<BidRequest.Builder, BidRequest>built(reqBuilder)).isEqualTo(req);
  assertThat(ProtoUtils.<BidRequest, BidRequest>built(req)).isSameAs(req);
  assertThat(ProtoUtils.<BidRequest.Builder, BidRequest>built(null)).isNull();
  assertThat(ProtoUtils.builder(req).build()).isEqualTo(reqBuilder.build());
  assertThat(ProtoUtils.<BidRequest.Builder, BidRequest.Builder>builder(reqBuilder))
      .isSameAs(reqBuilder);
  assertThat(ProtoUtils.<BidRequest, BidRequest.Builder>builder(null)).isNull();
}
 
開發者ID:google,項目名稱:openrtb,代碼行數:13,代碼來源:ProtoUtilsTest.java

示例4: readBidRequest

import com.google.openrtb.OpenRtb.BidRequest; //導入方法依賴的package包/類
/**
 * Desserializes a {@link BidRequest} from JSON, with a provided {@link JsonParser}
 * which allows several choices of input and encoding.
 */
public final BidRequest.Builder readBidRequest(JsonParser par) throws IOException {
  if (emptyToNull(par)) {
    return null;
  }

  BidRequest.Builder req = BidRequest.newBuilder();
  for (startObject(par); endObject(par); par.nextToken()) {
    String fieldName = getCurrentName(par);
    if (par.nextToken() != JsonToken.VALUE_NULL) {
      readBidRequestField(par, req, fieldName);
    }
  }
  return req;
}
 
開發者ID:google,項目名稱:openrtb,代碼行數:19,代碼來源:OpenRtbJsonReader.java


注:本文中的com.google.openrtb.OpenRtb.BidRequest.Builder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。