11/*
2- * Copyright 2017 ObjectBox Ltd. All rights reserved.
2+ * Copyright 2017-2020 ObjectBox Ltd. All rights reserved.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2525 * (subject to change in a future version).
2626 */
2727@ 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 ;
3030 final long queryHandle ;
31- final Property <T > property ;
31+ final Property <? > property ;
3232 final int propertyId ;
3333
3434 boolean distinct ;
@@ -41,7 +41,7 @@ public class PropertyQuery<T> {
4141 String nullValueString ;
4242 long nullValueLong ;
4343
44- PropertyQuery (Query <T > query , Property <T > property ) {
44+ PropertyQuery (Query <? > query , Property <? > property ) {
4545 this .query = query ;
4646 queryHandle = query .handle ;
4747 this .property = property ;
@@ -97,7 +97,7 @@ native String nativeFindString(long handle, long cursorHandle, int propertyId, b
9797 native long nativeCount (long handle , long cursorHandle , int propertyId , boolean distinct );
9898
9999 /** Clears all values (e.g. distinct and null value). */
100- public PropertyQuery < T > reset () {
100+ public PropertyQuery reset () {
101101 distinct = false ;
102102 noCaseIfDistinct = true ;
103103 unique = false ;
@@ -115,7 +115,7 @@ public PropertyQuery<T> reset() {
115115 * Note: strings default to case-insensitive comparision;
116116 * to change that call {@link #distinct(QueryBuilder.StringOrder)}.
117117 */
118- public PropertyQuery < T > distinct () {
118+ public PropertyQuery distinct () {
119119 distinct = true ;
120120 return this ;
121121 }
@@ -124,7 +124,7 @@ public PropertyQuery<T> distinct() {
124124 * For string properties you can specify {@link io.objectbox.query.QueryBuilder.StringOrder#CASE_SENSITIVE} if you
125125 * want to have case sensitive distinct values (e.g. returning "foo","Foo","FOO" instead of "foo").
126126 */
127- public PropertyQuery < T > distinct (QueryBuilder .StringOrder stringOrder ) {
127+ public PropertyQuery distinct (QueryBuilder .StringOrder stringOrder ) {
128128 if (property .type != String .class ) {
129129 throw new RuntimeException ("Reserved for string properties, but got " + property );
130130 }
@@ -142,7 +142,7 @@ public PropertyQuery<T> distinct(QueryBuilder.StringOrder stringOrder) {
142142 * <p>
143143 * Will be ignored for find methods returning multiple values, e.g. {@link #findInts()}.
144144 */
145- public PropertyQuery < T > unique () {
145+ public PropertyQuery unique () {
146146 unique = true ;
147147 return this ;
148148 }
@@ -152,7 +152,7 @@ public PropertyQuery<T> unique() {
152152 * However, using this function, you can define an alternative value that will be returned for null values.
153153 * E.g. -1 for ins/longs or "NULL" for strings.
154154 */
155- public PropertyQuery < T > nullValue (Object nullValue ) {
155+ public PropertyQuery nullValue (Object nullValue ) {
156156 //noinspection ConstantConditions Annotation can not enforce non-null.
157157 if (nullValue == null ) {
158158 throw new IllegalArgumentException ("Null values are not allowed" );
0 commit comments