|
1 | 1 | /*
|
2 |
| - * Copyright 2017-2024 ObjectBox Ltd. All rights reserved. |
| 2 | + * Copyright 2017-2025 ObjectBox Ltd. All rights reserved. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
40 | 40 | import io.objectbox.query.PropertyQueryConditionImpl.StringCondition;
|
41 | 41 | import io.objectbox.query.PropertyQueryConditionImpl.StringCondition.Operation;
|
42 | 42 | import io.objectbox.query.PropertyQueryConditionImpl.StringStringCondition;
|
| 43 | +import io.objectbox.query.PropertyQueryConditionImpl.StringLongCondition; |
| 44 | +import io.objectbox.query.PropertyQueryConditionImpl.StringDoubleCondition; |
43 | 45 | import io.objectbox.query.Query;
|
44 | 46 | import io.objectbox.query.QueryBuilder.StringOrder;
|
45 | 47 |
|
@@ -496,21 +498,161 @@ public PropertyQueryCondition<ENTITY> containsElement(String value, StringOrder
|
496 | 498 | * For a String-key map property, matches if at least one key and value combination equals the given values
|
497 | 499 | * using {@link StringOrder#CASE_SENSITIVE StringOrder#CASE_SENSITIVE}.
|
498 | 500 | *
|
| 501 | + * @deprecated Use the {@link #equalKeyValue(String, String, StringOrder)} condition instead. |
| 502 | + * |
499 | 503 | * @see #containsKeyValue(String, String, StringOrder)
|
500 | 504 | */
|
| 505 | + @Deprecated |
501 | 506 | public PropertyQueryCondition<ENTITY> containsKeyValue(String key, String value) {
|
502 |
| - return new StringStringCondition<>(this, StringStringCondition.Operation.CONTAINS_KEY_VALUE, |
| 507 | + return new StringStringCondition<>(this, StringStringCondition.Operation.EQUAL_KEY_VALUE, |
503 | 508 | key, value, StringOrder.CASE_SENSITIVE);
|
504 | 509 | }
|
505 | 510 |
|
506 | 511 | /**
|
| 512 | + * @deprecated Use the {@link #equalKeyValue(String, String, StringOrder)} condition instead. |
507 | 513 | * @see #containsKeyValue(String, String)
|
508 | 514 | */
|
| 515 | + @Deprecated |
509 | 516 | public PropertyQueryCondition<ENTITY> containsKeyValue(String key, String value, StringOrder order) {
|
510 |
| - return new StringStringCondition<>(this, StringStringCondition.Operation.CONTAINS_KEY_VALUE, |
| 517 | + return new StringStringCondition<>(this, StringStringCondition.Operation.EQUAL_KEY_VALUE, |
| 518 | + key, value, order); |
| 519 | + } |
| 520 | + |
| 521 | + /** |
| 522 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is equal |
| 523 | + * to the given {@code key} and {@code value}. |
| 524 | + */ |
| 525 | + public PropertyQueryCondition<ENTITY> equalKeyValue(String key, String value, StringOrder order) { |
| 526 | + return new StringStringCondition<>(this, StringStringCondition.Operation.EQUAL_KEY_VALUE, |
| 527 | + key, value, order); |
| 528 | + } |
| 529 | + |
| 530 | + /** |
| 531 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is greater |
| 532 | + * than the given {@code key} and {@code value}. |
| 533 | + */ |
| 534 | + public PropertyQueryCondition<ENTITY> greaterKeyValue(String key, String value, StringOrder order) { |
| 535 | + return new StringStringCondition<>(this, StringStringCondition.Operation.GREATER_KEY_VALUE, |
| 536 | + key, value, order); |
| 537 | + } |
| 538 | + |
| 539 | + /** |
| 540 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is greater |
| 541 | + * than or equal to the given {@code key} and {@code value}. |
| 542 | + */ |
| 543 | + public PropertyQueryCondition<ENTITY> greaterOrEqualKeyValue(String key, String value, StringOrder order) { |
| 544 | + return new StringStringCondition<>(this, StringStringCondition.Operation.GREATER_EQUALS_KEY_VALUE, |
511 | 545 | key, value, order);
|
512 | 546 | }
|
513 | 547 |
|
| 548 | + /** |
| 549 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is less |
| 550 | + * than the given {@code key} and {@code value}. |
| 551 | + */ |
| 552 | + public PropertyQueryCondition<ENTITY> lessKeyValue(String key, String value, StringOrder order) { |
| 553 | + return new StringStringCondition<>(this, StringStringCondition.Operation.LESS_KEY_VALUE, |
| 554 | + key, value, order); |
| 555 | + } |
| 556 | + |
| 557 | + /** |
| 558 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is less |
| 559 | + * than or equal to the given {@code key} and {@code value}. |
| 560 | + */ |
| 561 | + public PropertyQueryCondition<ENTITY> lessOrEqualKeyValue(String key, String value, StringOrder order) { |
| 562 | + return new StringStringCondition<>(this, StringStringCondition.Operation.LESS_EQUALS_KEY_VALUE, |
| 563 | + key, value, order); |
| 564 | + } |
| 565 | + |
| 566 | + /** |
| 567 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is equal |
| 568 | + * to the given {@code key} and {@code value}. |
| 569 | + */ |
| 570 | + public PropertyQueryCondition<ENTITY> equalKeyValue(String key, long value) { |
| 571 | + return new StringLongCondition<>(this, StringLongCondition.Operation.EQUAL_KEY_VALUE, |
| 572 | + key, value); |
| 573 | + } |
| 574 | + |
| 575 | + /** |
| 576 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is greater |
| 577 | + * than the given {@code key} and {@code value}. |
| 578 | + */ |
| 579 | + public PropertyQueryCondition<ENTITY> greaterKeyValue(String key, long value) { |
| 580 | + return new StringLongCondition<>(this, StringLongCondition.Operation.GREATER_KEY_VALUE, |
| 581 | + key, value); |
| 582 | + } |
| 583 | + |
| 584 | + /** |
| 585 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is greater |
| 586 | + * than or equal to the given {@code key} and {@code value}. |
| 587 | + */ |
| 588 | + public PropertyQueryCondition<ENTITY> greaterOrEqualKeyValue(String key, long value) { |
| 589 | + return new StringLongCondition<>(this, StringLongCondition.Operation.GREATER_EQUALS_KEY_VALUE, |
| 590 | + key, value); |
| 591 | + } |
| 592 | + |
| 593 | + /** |
| 594 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is less |
| 595 | + * than the given {@code key} and {@code value}. |
| 596 | + */ |
| 597 | + public PropertyQueryCondition<ENTITY> lessKeyValue(String key, long value) { |
| 598 | + return new StringLongCondition<>(this, StringLongCondition.Operation.LESS_KEY_VALUE, |
| 599 | + key, value); |
| 600 | + } |
| 601 | + |
| 602 | + /** |
| 603 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is less |
| 604 | + * than or equal to the given {@code key} and {@code value}. |
| 605 | + */ |
| 606 | + public PropertyQueryCondition<ENTITY> lessOrEqualKeyValue(String key, long value) { |
| 607 | + return new StringLongCondition<>(this, StringLongCondition.Operation.LESS_EQUALS_KEY_VALUE, |
| 608 | + key, value); |
| 609 | + } |
| 610 | + |
| 611 | + /** |
| 612 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is equal |
| 613 | + * to the given {@code key} and {@code value}. |
| 614 | + */ |
| 615 | + public PropertyQueryCondition<ENTITY> equalKeyValue(String key, double value) { |
| 616 | + return new StringDoubleCondition<>(this, StringDoubleCondition.Operation.EQUAL_KEY_VALUE, |
| 617 | + key, value); |
| 618 | + } |
| 619 | + |
| 620 | + /** |
| 621 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is greater |
| 622 | + * than the given {@code key} and {@code value}. |
| 623 | + */ |
| 624 | + public PropertyQueryCondition<ENTITY> greaterKeyValue(String key, double value) { |
| 625 | + return new StringDoubleCondition<>(this, StringDoubleCondition.Operation.GREATER_KEY_VALUE, |
| 626 | + key, value); |
| 627 | + } |
| 628 | + |
| 629 | + /** |
| 630 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is greater |
| 631 | + * than or equal to the given {@code key} and {@code value}. |
| 632 | + */ |
| 633 | + public PropertyQueryCondition<ENTITY> greaterOrEqualKeyValue(String key, double value) { |
| 634 | + return new StringDoubleCondition<>(this, StringDoubleCondition.Operation.GREATER_EQUALS_KEY_VALUE, |
| 635 | + key, value); |
| 636 | + } |
| 637 | + |
| 638 | + /** |
| 639 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is less |
| 640 | + * than the given {@code key} and {@code value}. |
| 641 | + */ |
| 642 | + public PropertyQueryCondition<ENTITY> lessKeyValue(String key, double value) { |
| 643 | + return new StringDoubleCondition<>(this, StringDoubleCondition.Operation.LESS_KEY_VALUE, |
| 644 | + key, value); |
| 645 | + } |
| 646 | + |
| 647 | + /** |
| 648 | + * For a String-key map property, matches the combination where the key and value of at least one map entry is less |
| 649 | + * than or equal to the given {@code key} and {@code value}. |
| 650 | + */ |
| 651 | + public PropertyQueryCondition<ENTITY> lessOrEqualKeyValue(String key, double value) { |
| 652 | + return new StringDoubleCondition<>(this, StringDoubleCondition.Operation.LESS_EQUALS_KEY_VALUE, |
| 653 | + key, value); |
| 654 | + } |
| 655 | + |
514 | 656 | /**
|
515 | 657 | * Creates a starts with condition using {@link StringOrder#CASE_SENSITIVE StringOrder#CASE_SENSITIVE}.
|
516 | 658 | *
|
|
0 commit comments