2222import java .util .Date ;
2323import java .util .List ;
2424
25+ import javax .annotation .Nullable ;
26+
2527import io .objectbox .Box ;
2628import io .objectbox .EntityInfo ;
2729import io .objectbox .Property ;
2830import io .objectbox .annotation .apihint .Experimental ;
2931import io .objectbox .annotation .apihint .Internal ;
3032import io .objectbox .relation .RelationInfo ;
3133
32- import javax .annotation .Nullable ;
33-
3434/**
3535 * With QueryBuilder you define custom queries returning matching entities. Using the methods of this class you can
3636 * select (filter) results for specific data (for example #{@link #equal(Property, String)} and
@@ -601,42 +601,96 @@ public QueryBuilder<T> notIn(Property<T> property, int[] values) {
601601 // String
602602 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
603603
604+ /**
605+ * Creates an "equal ('=')" condition for this property.
606+ * <p>
607+ * Ignores case when matching results, e.g. {@code equal(prop, "example")} matches both "Example" and "example".
608+ * <p>
609+ * Use {@link #equal(Property, String, StringOrder) equal(prop, value, StringOrder.CASE_SENSITIVE)} to only match
610+ * if case is equal.
611+ * <p>
612+ * Note: Use a case sensitive condition to utilize an {@link io.objectbox.annotation.Index @Index}
613+ * on {@code property}, dramatically speeding up look-up of results.
614+ */
604615 public QueryBuilder <T > equal (Property <T > property , String value ) {
605616 verifyHandle ();
606617 checkCombineCondition (nativeEqual (handle , property .getId (), value , false ));
607618 return this ;
608619 }
609620
621+ /**
622+ * Creates an "equal ('=')" condition for this property.
623+ * <p>
624+ * Set {@code order} to {@link StringOrder#CASE_SENSITIVE StringOrder.CASE_SENSITIVE} to only match
625+ * if case is equal. E.g. {@code equal(prop, "example", StringOrder.CASE_SENSITIVE)} only matches "example",
626+ * but not "Example".
627+ * <p>
628+ * Note: Use a case sensitive condition to utilize an {@link io.objectbox.annotation.Index @Index}
629+ * on {@code property}, dramatically speeding up look-up of results.
630+ */
610631 public QueryBuilder <T > equal (Property <T > property , String value , StringOrder order ) {
611632 verifyHandle ();
612633 checkCombineCondition (nativeEqual (handle , property .getId (), value , order == StringOrder .CASE_SENSITIVE ));
613634 return this ;
614635 }
615636
637+ /**
638+ * Creates a "not equal ('<>')" condition for this property.
639+ * <p>
640+ * Ignores case when matching results, e.g. {@code notEqual(prop, "example")} excludes both "Example" and "example".
641+ * <p>
642+ * Use {@link #notEqual(Property, String, StringOrder) notEqual(prop, value, StringOrder.CASE_SENSITIVE)} to only exclude
643+ * if case is equal.
644+ * <p>
645+ * Note: Use a case sensitive condition to utilize an {@link io.objectbox.annotation.Index @Index}
646+ * on {@code property}, dramatically speeding up look-up of results.
647+ */
616648 public QueryBuilder <T > notEqual (Property <T > property , String value ) {
617649 verifyHandle ();
618650 checkCombineCondition (nativeNotEqual (handle , property .getId (), value , false ));
619651 return this ;
620652 }
621653
654+ /**
655+ * Creates a "not equal ('<>')" condition for this property.
656+ * <p>
657+ * Set {@code order} to {@link StringOrder#CASE_SENSITIVE StringOrder.CASE_SENSITIVE} to only exclude
658+ * if case is equal. E.g. {@code notEqual(prop, "example", StringOrder.CASE_SENSITIVE)} only excludes "example",
659+ * but not "Example".
660+ * <p>
661+ * Note: Use a case sensitive condition to utilize an {@link io.objectbox.annotation.Index @Index}
662+ * on {@code property}, dramatically speeding up look-up of results.
663+ */
622664 public QueryBuilder <T > notEqual (Property <T > property , String value , StringOrder order ) {
623665 verifyHandle ();
624666 checkCombineCondition (nativeNotEqual (handle , property .getId (), value , order == StringOrder .CASE_SENSITIVE ));
625667 return this ;
626668 }
627669
670+ /**
671+ * Ignores case when matching results. Use the overload and pass
672+ * {@link StringOrder#CASE_SENSITIVE StringOrder.CASE_SENSITIVE} to specify that case should not be ignored.
673+ */
628674 public QueryBuilder <T > contains (Property <T > property , String value ) {
629675 verifyHandle ();
630676 checkCombineCondition (nativeContains (handle , property .getId (), value , false ));
631677 return this ;
632678 }
633679
680+ /**
681+ * Ignores case when matching results. Use the overload and pass
682+ * {@link StringOrder#CASE_SENSITIVE StringOrder.CASE_SENSITIVE} to specify that case should not be ignored.
683+ */
634684 public QueryBuilder <T > startsWith (Property <T > property , String value ) {
635685 verifyHandle ();
636686 checkCombineCondition (nativeStartsWith (handle , property .getId (), value , false ));
637687 return this ;
638688 }
639689
690+ /**
691+ * Ignores case when matching results. Use the overload and pass
692+ * {@link StringOrder#CASE_SENSITIVE StringOrder.CASE_SENSITIVE} to specify that case should not be ignored.
693+ */
640694 public QueryBuilder <T > endsWith (Property <T > property , String value ) {
641695 verifyHandle ();
642696 checkCombineCondition (nativeEndsWith (handle , property .getId (), value , false ));
@@ -661,6 +715,10 @@ public QueryBuilder<T> endsWith(Property<T> property, String value, StringOrder
661715 return this ;
662716 }
663717
718+ /**
719+ * Ignores case when matching results. Use the overload and pass
720+ * {@link StringOrder#CASE_SENSITIVE StringOrder.CASE_SENSITIVE} to specify that case should not be ignored.
721+ */
664722 public QueryBuilder <T > less (Property <T > property , String value ) {
665723 return less (property , value , StringOrder .CASE_INSENSITIVE );
666724 }
@@ -671,6 +729,10 @@ public QueryBuilder<T> less(Property<T> property, String value, StringOrder orde
671729 return this ;
672730 }
673731
732+ /**
733+ * Ignores case when matching results. Use the overload and pass
734+ * {@link StringOrder#CASE_SENSITIVE StringOrder.CASE_SENSITIVE} to specify that case should not be ignored.
735+ */
674736 public QueryBuilder <T > greater (Property <T > property , String value ) {
675737 return greater (property , value , StringOrder .CASE_INSENSITIVE );
676738 }
@@ -681,6 +743,10 @@ public QueryBuilder<T> greater(Property<T> property, String value, StringOrder o
681743 return this ;
682744 }
683745
746+ /**
747+ * Ignores case when matching results. Use the overload and pass
748+ * {@link StringOrder#CASE_SENSITIVE StringOrder.CASE_SENSITIVE} to specify that case should not be ignored.
749+ */
684750 public QueryBuilder <T > in (Property <T > property , String [] values ) {
685751 return in (property , values , StringOrder .CASE_INSENSITIVE );
686752 }
0 commit comments