1
1
/*
2
- * Copyright 2017 ObjectBox Ltd. All rights reserved.
2
+ * Copyright 2017-2020 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.
25
25
* (subject to change in a future version).
26
26
*/
27
27
@ SuppressWarnings ("WeakerAccess" ) // WeakerAccess: allow inner class access without accessor
28
- public class PropertyQuery < T > {
29
- final Query <T > query ;
28
+ public class PropertyQuery {
29
+ final Query <? > query ;
30
30
final long queryHandle ;
31
- final Property <T > property ;
31
+ final Property <? > property ;
32
32
final int propertyId ;
33
33
34
34
boolean distinct ;
@@ -41,7 +41,7 @@ public class PropertyQuery<T> {
41
41
String nullValueString ;
42
42
long nullValueLong ;
43
43
44
- PropertyQuery (Query <T > query , Property <T > property ) {
44
+ PropertyQuery (Query <? > query , Property <? > property ) {
45
45
this .query = query ;
46
46
queryHandle = query .handle ;
47
47
this .property = property ;
@@ -97,7 +97,7 @@ native String nativeFindString(long handle, long cursorHandle, int propertyId, b
97
97
native long nativeCount (long handle , long cursorHandle , int propertyId , boolean distinct );
98
98
99
99
/** Clears all values (e.g. distinct and null value). */
100
- public PropertyQuery < T > reset () {
100
+ public PropertyQuery reset () {
101
101
distinct = false ;
102
102
noCaseIfDistinct = true ;
103
103
unique = false ;
@@ -115,7 +115,7 @@ public PropertyQuery<T> reset() {
115
115
* Note: strings default to case-insensitive comparision;
116
116
* to change that call {@link #distinct(QueryBuilder.StringOrder)}.
117
117
*/
118
- public PropertyQuery < T > distinct () {
118
+ public PropertyQuery distinct () {
119
119
distinct = true ;
120
120
return this ;
121
121
}
@@ -124,7 +124,7 @@ public PropertyQuery<T> distinct() {
124
124
* For string properties you can specify {@link io.objectbox.query.QueryBuilder.StringOrder#CASE_SENSITIVE} if you
125
125
* want to have case sensitive distinct values (e.g. returning "foo","Foo","FOO" instead of "foo").
126
126
*/
127
- public PropertyQuery < T > distinct (QueryBuilder .StringOrder stringOrder ) {
127
+ public PropertyQuery distinct (QueryBuilder .StringOrder stringOrder ) {
128
128
if (property .type != String .class ) {
129
129
throw new RuntimeException ("Reserved for string properties, but got " + property );
130
130
}
@@ -142,7 +142,7 @@ public PropertyQuery<T> distinct(QueryBuilder.StringOrder stringOrder) {
142
142
* <p>
143
143
* Will be ignored for find methods returning multiple values, e.g. {@link #findInts()}.
144
144
*/
145
- public PropertyQuery < T > unique () {
145
+ public PropertyQuery unique () {
146
146
unique = true ;
147
147
return this ;
148
148
}
@@ -152,7 +152,7 @@ public PropertyQuery<T> unique() {
152
152
* However, using this function, you can define an alternative value that will be returned for null values.
153
153
* E.g. -1 for ins/longs or "NULL" for strings.
154
154
*/
155
- public PropertyQuery < T > nullValue (Object nullValue ) {
155
+ public PropertyQuery nullValue (Object nullValue ) {
156
156
//noinspection ConstantConditions Annotation can not enforce non-null.
157
157
if (nullValue == null ) {
158
158
throw new IllegalArgumentException ("Null values are not allowed" );
0 commit comments