001 002package com.commercetools.api.client; 003 004import java.net.URI; 005import java.time.Duration; 006import java.util.ArrayList; 007import java.util.Collection; 008import java.util.List; 009import java.util.concurrent.CompletableFuture; 010import java.util.function.Function; 011import java.util.function.Supplier; 012import java.util.stream.Collectors; 013 014import io.vrap.rmf.base.client.*; 015import io.vrap.rmf.base.client.utils.Generated; 016 017import org.apache.commons.lang3.builder.EqualsBuilder; 018import org.apache.commons.lang3.builder.HashCodeBuilder; 019 020/** 021 * 022 * 023 * <hr> 024 * <div class=code-example> 025 * <pre><code class='java'>{@code 026 * CompletableFuture<ApiHttpResponse<com.commercetools.api.models.customer.Customer>> result = apiRoot 027 * .withProjectKey("{projectKey}") 028 * .inStoreKeyWithStoreKeyValue("{storeKey}") 029 * .me() 030 * .get() 031 * .execute() 032 * }</code></pre> 033 * </div> 034 */ 035@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 036public class ByProjectKeyInStoreKeyByStoreKeyMeGet 037 extends ApiMethod<ByProjectKeyInStoreKeyByStoreKeyMeGet, com.commercetools.api.models.customer.Customer> 038 implements com.commercetools.api.client.SortableTrait<ByProjectKeyInStoreKeyByStoreKeyMeGet>, 039 com.commercetools.api.client.PagingTrait<ByProjectKeyInStoreKeyByStoreKeyMeGet>, 040 com.commercetools.api.client.ExpandableTrait<ByProjectKeyInStoreKeyByStoreKeyMeGet>, 041 com.commercetools.api.client.QueryTrait<ByProjectKeyInStoreKeyByStoreKeyMeGet> { 042 043 private String projectKey; 044 private String storeKey; 045 046 public ByProjectKeyInStoreKeyByStoreKeyMeGet(final ApiHttpClient apiHttpClient, String projectKey, 047 String storeKey) { 048 super(apiHttpClient); 049 this.projectKey = projectKey; 050 this.storeKey = storeKey; 051 } 052 053 public ByProjectKeyInStoreKeyByStoreKeyMeGet(ByProjectKeyInStoreKeyByStoreKeyMeGet t) { 054 super(t); 055 this.projectKey = t.projectKey; 056 this.storeKey = t.storeKey; 057 } 058 059 @Override 060 protected ApiHttpRequest buildHttpRequest() { 061 List<String> params = new ArrayList<>(getQueryParamUriStrings()); 062 String httpRequestPath = String.format("%s/in-store/key=%s/me", this.projectKey, this.storeKey); 063 if (!params.isEmpty()) { 064 httpRequestPath += "?" + String.join("&", params); 065 } 066 return new ApiHttpRequest(ApiHttpMethod.GET, URI.create(httpRequestPath), getHeaders(), null); 067 } 068 069 @Override 070 public ApiHttpResponse<com.commercetools.api.models.customer.Customer> executeBlocking(final ApiHttpClient client, 071 final Duration timeout) { 072 return executeBlocking(client, timeout, com.commercetools.api.models.customer.Customer.class); 073 } 074 075 @Override 076 public CompletableFuture<ApiHttpResponse<com.commercetools.api.models.customer.Customer>> execute( 077 final ApiHttpClient client) { 078 return execute(client, com.commercetools.api.models.customer.Customer.class); 079 } 080 081 public String getProjectKey() { 082 return this.projectKey; 083 } 084 085 public String getStoreKey() { 086 return this.storeKey; 087 } 088 089 public List<String> getSort() { 090 return this.getQueryParam("sort"); 091 } 092 093 public List<String> getLimit() { 094 return this.getQueryParam("limit"); 095 } 096 097 public List<String> getOffset() { 098 return this.getQueryParam("offset"); 099 } 100 101 public List<String> getWithTotal() { 102 return this.getQueryParam("withTotal"); 103 } 104 105 public List<String> getExpand() { 106 return this.getQueryParam("expand"); 107 } 108 109 public List<String> getWhere() { 110 return this.getQueryParam("where"); 111 } 112 113 public void setProjectKey(final String projectKey) { 114 this.projectKey = projectKey; 115 } 116 117 public void setStoreKey(final String storeKey) { 118 this.storeKey = storeKey; 119 } 120 121 /** 122 * set sort with the specified value 123 * @param sort value to be set 124 * @param <TValue> value type 125 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 126 */ 127 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withSort(final TValue sort) { 128 return copy().withQueryParam("sort", sort); 129 } 130 131 /** 132 * add additional sort query parameter 133 * @param sort value to be added 134 * @param <TValue> value type 135 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 136 */ 137 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addSort(final TValue sort) { 138 return copy().addQueryParam("sort", sort); 139 } 140 141 /** 142 * set sort with the specified value 143 * @param supplier supplier for the value to be set 144 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 145 */ 146 public ByProjectKeyInStoreKeyByStoreKeyMeGet withSort(final Supplier<String> supplier) { 147 return copy().withQueryParam("sort", supplier.get()); 148 } 149 150 /** 151 * add additional sort query parameter 152 * @param supplier supplier for the value to be added 153 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 154 */ 155 public ByProjectKeyInStoreKeyByStoreKeyMeGet addSort(final Supplier<String> supplier) { 156 return copy().addQueryParam("sort", supplier.get()); 157 } 158 159 /** 160 * set sort with the specified value 161 * @param op builder for the value to be set 162 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 163 */ 164 public ByProjectKeyInStoreKeyByStoreKeyMeGet withSort(final Function<StringBuilder, StringBuilder> op) { 165 return copy().withQueryParam("sort", op.apply(new StringBuilder())); 166 } 167 168 /** 169 * add additional sort query parameter 170 * @param op builder for the value to be added 171 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 172 */ 173 public ByProjectKeyInStoreKeyByStoreKeyMeGet addSort(final Function<StringBuilder, StringBuilder> op) { 174 return copy().addQueryParam("sort", op.apply(new StringBuilder())); 175 } 176 177 /** 178 * set sort with the specified values 179 * @param sort values to be set 180 * @param <TValue> value type 181 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 182 */ 183 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withSort(final Collection<TValue> sort) { 184 return copy().withoutQueryParam("sort") 185 .addQueryParams( 186 sort.stream().map(s -> new ParamEntry<>("sort", s.toString())).collect(Collectors.toList())); 187 } 188 189 /** 190 * add additional sort query parameters 191 * @param sort values to be added 192 * @param <TValue> value type 193 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 194 */ 195 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addSort(final Collection<TValue> sort) { 196 return copy().addQueryParams( 197 sort.stream().map(s -> new ParamEntry<>("sort", s.toString())).collect(Collectors.toList())); 198 } 199 200 /** 201 * set limit with the specified value 202 * @param limit value to be set 203 * @param <TValue> value type 204 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 205 */ 206 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withLimit(final TValue limit) { 207 return copy().withQueryParam("limit", limit); 208 } 209 210 /** 211 * add additional limit query parameter 212 * @param limit value to be added 213 * @param <TValue> value type 214 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 215 */ 216 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addLimit(final TValue limit) { 217 return copy().addQueryParam("limit", limit); 218 } 219 220 /** 221 * set limit with the specified value 222 * @param supplier supplier for the value to be set 223 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 224 */ 225 public ByProjectKeyInStoreKeyByStoreKeyMeGet withLimit(final Supplier<Integer> supplier) { 226 return copy().withQueryParam("limit", supplier.get()); 227 } 228 229 /** 230 * add additional limit query parameter 231 * @param supplier supplier for the value to be added 232 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 233 */ 234 public ByProjectKeyInStoreKeyByStoreKeyMeGet addLimit(final Supplier<Integer> supplier) { 235 return copy().addQueryParam("limit", supplier.get()); 236 } 237 238 /** 239 * set limit with the specified value 240 * @param op builder for the value to be set 241 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 242 */ 243 public ByProjectKeyInStoreKeyByStoreKeyMeGet withLimit(final Function<StringBuilder, StringBuilder> op) { 244 return copy().withQueryParam("limit", op.apply(new StringBuilder())); 245 } 246 247 /** 248 * add additional limit query parameter 249 * @param op builder for the value to be added 250 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 251 */ 252 public ByProjectKeyInStoreKeyByStoreKeyMeGet addLimit(final Function<StringBuilder, StringBuilder> op) { 253 return copy().addQueryParam("limit", op.apply(new StringBuilder())); 254 } 255 256 /** 257 * set limit with the specified values 258 * @param limit values to be set 259 * @param <TValue> value type 260 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 261 */ 262 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withLimit(final Collection<TValue> limit) { 263 return copy().withoutQueryParam("limit") 264 .addQueryParams( 265 limit.stream().map(s -> new ParamEntry<>("limit", s.toString())).collect(Collectors.toList())); 266 } 267 268 /** 269 * add additional limit query parameters 270 * @param limit values to be added 271 * @param <TValue> value type 272 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 273 */ 274 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addLimit(final Collection<TValue> limit) { 275 return copy().addQueryParams( 276 limit.stream().map(s -> new ParamEntry<>("limit", s.toString())).collect(Collectors.toList())); 277 } 278 279 /** 280 * set offset with the specified value 281 * @param offset value to be set 282 * @param <TValue> value type 283 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 284 */ 285 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withOffset(final TValue offset) { 286 return copy().withQueryParam("offset", offset); 287 } 288 289 /** 290 * add additional offset query parameter 291 * @param offset value to be added 292 * @param <TValue> value type 293 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 294 */ 295 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addOffset(final TValue offset) { 296 return copy().addQueryParam("offset", offset); 297 } 298 299 /** 300 * set offset with the specified value 301 * @param supplier supplier for the value to be set 302 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 303 */ 304 public ByProjectKeyInStoreKeyByStoreKeyMeGet withOffset(final Supplier<Integer> supplier) { 305 return copy().withQueryParam("offset", supplier.get()); 306 } 307 308 /** 309 * add additional offset query parameter 310 * @param supplier supplier for the value to be added 311 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 312 */ 313 public ByProjectKeyInStoreKeyByStoreKeyMeGet addOffset(final Supplier<Integer> supplier) { 314 return copy().addQueryParam("offset", supplier.get()); 315 } 316 317 /** 318 * set offset with the specified value 319 * @param op builder for the value to be set 320 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 321 */ 322 public ByProjectKeyInStoreKeyByStoreKeyMeGet withOffset(final Function<StringBuilder, StringBuilder> op) { 323 return copy().withQueryParam("offset", op.apply(new StringBuilder())); 324 } 325 326 /** 327 * add additional offset query parameter 328 * @param op builder for the value to be added 329 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 330 */ 331 public ByProjectKeyInStoreKeyByStoreKeyMeGet addOffset(final Function<StringBuilder, StringBuilder> op) { 332 return copy().addQueryParam("offset", op.apply(new StringBuilder())); 333 } 334 335 /** 336 * set offset with the specified values 337 * @param offset values to be set 338 * @param <TValue> value type 339 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 340 */ 341 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withOffset(final Collection<TValue> offset) { 342 return copy().withoutQueryParam("offset") 343 .addQueryParams( 344 offset.stream().map(s -> new ParamEntry<>("offset", s.toString())).collect(Collectors.toList())); 345 } 346 347 /** 348 * add additional offset query parameters 349 * @param offset values to be added 350 * @param <TValue> value type 351 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 352 */ 353 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addOffset(final Collection<TValue> offset) { 354 return copy().addQueryParams( 355 offset.stream().map(s -> new ParamEntry<>("offset", s.toString())).collect(Collectors.toList())); 356 } 357 358 /** 359 * set withTotal with the specified value 360 * @param withTotal value to be set 361 * @param <TValue> value type 362 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 363 */ 364 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withWithTotal(final TValue withTotal) { 365 return copy().withQueryParam("withTotal", withTotal); 366 } 367 368 /** 369 * add additional withTotal query parameter 370 * @param withTotal value to be added 371 * @param <TValue> value type 372 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 373 */ 374 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addWithTotal(final TValue withTotal) { 375 return copy().addQueryParam("withTotal", withTotal); 376 } 377 378 /** 379 * set withTotal with the specified value 380 * @param supplier supplier for the value to be set 381 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 382 */ 383 public ByProjectKeyInStoreKeyByStoreKeyMeGet withWithTotal(final Supplier<Boolean> supplier) { 384 return copy().withQueryParam("withTotal", supplier.get()); 385 } 386 387 /** 388 * add additional withTotal query parameter 389 * @param supplier supplier for the value to be added 390 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 391 */ 392 public ByProjectKeyInStoreKeyByStoreKeyMeGet addWithTotal(final Supplier<Boolean> supplier) { 393 return copy().addQueryParam("withTotal", supplier.get()); 394 } 395 396 /** 397 * set withTotal with the specified value 398 * @param op builder for the value to be set 399 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 400 */ 401 public ByProjectKeyInStoreKeyByStoreKeyMeGet withWithTotal(final Function<StringBuilder, StringBuilder> op) { 402 return copy().withQueryParam("withTotal", op.apply(new StringBuilder())); 403 } 404 405 /** 406 * add additional withTotal query parameter 407 * @param op builder for the value to be added 408 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 409 */ 410 public ByProjectKeyInStoreKeyByStoreKeyMeGet addWithTotal(final Function<StringBuilder, StringBuilder> op) { 411 return copy().addQueryParam("withTotal", op.apply(new StringBuilder())); 412 } 413 414 /** 415 * set withTotal with the specified values 416 * @param withTotal values to be set 417 * @param <TValue> value type 418 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 419 */ 420 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withWithTotal(final Collection<TValue> withTotal) { 421 return copy().withoutQueryParam("withTotal") 422 .addQueryParams(withTotal.stream() 423 .map(s -> new ParamEntry<>("withTotal", s.toString())) 424 .collect(Collectors.toList())); 425 } 426 427 /** 428 * add additional withTotal query parameters 429 * @param withTotal values to be added 430 * @param <TValue> value type 431 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 432 */ 433 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addWithTotal(final Collection<TValue> withTotal) { 434 return copy().addQueryParams( 435 withTotal.stream().map(s -> new ParamEntry<>("withTotal", s.toString())).collect(Collectors.toList())); 436 } 437 438 /** 439 * set expand with the specified value 440 * @param expand value to be set 441 * @param <TValue> value type 442 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 443 */ 444 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withExpand(final TValue expand) { 445 return copy().withQueryParam("expand", expand); 446 } 447 448 /** 449 * add additional expand query parameter 450 * @param expand value to be added 451 * @param <TValue> value type 452 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 453 */ 454 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addExpand(final TValue expand) { 455 return copy().addQueryParam("expand", expand); 456 } 457 458 /** 459 * set expand with the specified value 460 * @param supplier supplier for the value to be set 461 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 462 */ 463 public ByProjectKeyInStoreKeyByStoreKeyMeGet withExpand(final Supplier<String> supplier) { 464 return copy().withQueryParam("expand", supplier.get()); 465 } 466 467 /** 468 * add additional expand query parameter 469 * @param supplier supplier for the value to be added 470 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 471 */ 472 public ByProjectKeyInStoreKeyByStoreKeyMeGet addExpand(final Supplier<String> supplier) { 473 return copy().addQueryParam("expand", supplier.get()); 474 } 475 476 /** 477 * set expand with the specified value 478 * @param op builder for the value to be set 479 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 480 */ 481 public ByProjectKeyInStoreKeyByStoreKeyMeGet withExpand(final Function<StringBuilder, StringBuilder> op) { 482 return copy().withQueryParam("expand", op.apply(new StringBuilder())); 483 } 484 485 /** 486 * add additional expand query parameter 487 * @param op builder for the value to be added 488 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 489 */ 490 public ByProjectKeyInStoreKeyByStoreKeyMeGet addExpand(final Function<StringBuilder, StringBuilder> op) { 491 return copy().addQueryParam("expand", op.apply(new StringBuilder())); 492 } 493 494 /** 495 * set expand with the specified values 496 * @param expand values to be set 497 * @param <TValue> value type 498 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 499 */ 500 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withExpand(final Collection<TValue> expand) { 501 return copy().withoutQueryParam("expand") 502 .addQueryParams( 503 expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); 504 } 505 506 /** 507 * add additional expand query parameters 508 * @param expand values to be added 509 * @param <TValue> value type 510 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 511 */ 512 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addExpand(final Collection<TValue> expand) { 513 return copy().addQueryParams( 514 expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); 515 } 516 517 /** 518 * set where with the specified value 519 * @param where value to be set 520 * @param <TValue> value type 521 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 522 */ 523 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withWhere(final TValue where) { 524 return copy().withQueryParam("where", where); 525 } 526 527 /** 528 * add additional where query parameter 529 * @param where value to be added 530 * @param <TValue> value type 531 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 532 */ 533 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addWhere(final TValue where) { 534 return copy().addQueryParam("where", where); 535 } 536 537 /** 538 * set where with the specified value 539 * @param supplier supplier for the value to be set 540 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 541 */ 542 public ByProjectKeyInStoreKeyByStoreKeyMeGet withWhere(final Supplier<String> supplier) { 543 return copy().withQueryParam("where", supplier.get()); 544 } 545 546 /** 547 * add additional where query parameter 548 * @param supplier supplier for the value to be added 549 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 550 */ 551 public ByProjectKeyInStoreKeyByStoreKeyMeGet addWhere(final Supplier<String> supplier) { 552 return copy().addQueryParam("where", supplier.get()); 553 } 554 555 /** 556 * set where with the specified value 557 * @param op builder for the value to be set 558 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 559 */ 560 public ByProjectKeyInStoreKeyByStoreKeyMeGet withWhere(final Function<StringBuilder, StringBuilder> op) { 561 return copy().withQueryParam("where", op.apply(new StringBuilder())); 562 } 563 564 /** 565 * add additional where query parameter 566 * @param op builder for the value to be added 567 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 568 */ 569 public ByProjectKeyInStoreKeyByStoreKeyMeGet addWhere(final Function<StringBuilder, StringBuilder> op) { 570 return copy().addQueryParam("where", op.apply(new StringBuilder())); 571 } 572 573 /** 574 * set where with the specified values 575 * @param where values to be set 576 * @param <TValue> value type 577 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 578 */ 579 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withWhere(final Collection<TValue> where) { 580 return copy().withoutQueryParam("where") 581 .addQueryParams( 582 where.stream().map(s -> new ParamEntry<>("where", s.toString())).collect(Collectors.toList())); 583 } 584 585 /** 586 * add additional where query parameters 587 * @param where values to be added 588 * @param <TValue> value type 589 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 590 */ 591 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addWhere(final Collection<TValue> where) { 592 return copy().addQueryParams( 593 where.stream().map(s -> new ParamEntry<>("where", s.toString())).collect(Collectors.toList())); 594 } 595 596 /** 597 * set predicateVar with the specificied value 598 * @param <TValue> value type 599 * @param varName parameter name 600 * @param predicateVar parameter value 601 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 602 */ 603 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withPredicateVar(final String varName, 604 final TValue predicateVar) { 605 return copy().withQueryParam(String.format("var.%s", varName), predicateVar); 606 } 607 608 /** 609 * add additional predicateVar query parameter 610 * @param <TValue> value type 611 * @param varName parameter name 612 * @param predicateVar parameter value 613 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 614 */ 615 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addPredicateVar(final String varName, 616 final TValue predicateVar) { 617 return copy().addQueryParam(String.format("var.%s", varName), predicateVar); 618 } 619 620 /** 621 * set predicateVar with the specificied values 622 * @param <TValue> value type 623 * @param varName parameter name 624 * @param predicateVar parameter values 625 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 626 */ 627 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet withPredicateVar(final String varName, 628 final Collection<TValue> predicateVar) { 629 final String placeholderName = String.format("var.%s", varName); 630 return copy().withoutQueryParam(placeholderName) 631 .addQueryParams(predicateVar.stream() 632 .map(s -> new ParamEntry<>(placeholderName, s.toString())) 633 .collect(Collectors.toList())); 634 } 635 636 /** 637 * add additional predicateVar query parameters 638 * @param <TValue> value type 639 * @param varName parameter name 640 * @param predicateVar parameter values 641 * @return ByProjectKeyInStoreKeyByStoreKeyMeGet 642 */ 643 public <TValue> ByProjectKeyInStoreKeyByStoreKeyMeGet addPredicateVar(final String varName, 644 final Collection<TValue> predicateVar) { 645 final String placeholderName = String.format("var.%s", varName); 646 return copy().addQueryParams(predicateVar.stream() 647 .map(s -> new ParamEntry<>(placeholderName, s.toString())) 648 .collect(Collectors.toList())); 649 } 650 651 @Override 652 public boolean equals(Object o) { 653 if (this == o) 654 return true; 655 656 if (o == null || getClass() != o.getClass()) 657 return false; 658 659 ByProjectKeyInStoreKeyByStoreKeyMeGet that = (ByProjectKeyInStoreKeyByStoreKeyMeGet) o; 660 661 return new EqualsBuilder().append(projectKey, that.projectKey).append(storeKey, that.storeKey).isEquals(); 662 } 663 664 @Override 665 public int hashCode() { 666 return new HashCodeBuilder(17, 37).append(projectKey).append(storeKey).toHashCode(); 667 } 668 669 @Override 670 protected ByProjectKeyInStoreKeyByStoreKeyMeGet copy() { 671 return new ByProjectKeyInStoreKeyByStoreKeyMeGet(this); 672 } 673}