Skip to content

Commit dcea757

Browse files
Property: allow generic converter class again.
This is a regression from Enforce db and Java types match for PropertyConverter in Property constructors. #1005
1 parent 5ad9ba0 commit dcea757

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

objectbox-java/src/main/java/io/objectbox/Property.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public class Property<ENTITY> implements Serializable {
5959
public final boolean isId;
6060
public final boolean isVirtual;
6161
public final String dbName;
62-
public final Class<? extends PropertyConverter<?, ?>> converterClass;
62+
@SuppressWarnings("rawtypes") // Use raw type of PropertyConverter to allow users to supply a generic implementation.
63+
public final Class<? extends PropertyConverter> converterClass;
6364

6465
/** Type, which is converted to a type supported by the DB. */
6566
public final Class<?> customType;
@@ -81,16 +82,17 @@ public Property(EntityInfo<ENTITY> entity, int ordinal, int id, Class<?> type, S
8182
this(entity, ordinal, id, type, name, isId, dbName, null, null);
8283
}
8384

84-
// Note: types of PropertyConverter might not exactly match type and customtype, e.g. if using generics like List.class.
85+
@SuppressWarnings("rawtypes") // Use raw type of PropertyConverter to allow users to supply a generic implementation.
8586
public Property(EntityInfo<ENTITY> entity, int ordinal, int id, Class<?> type, String name, boolean isId,
86-
@Nullable String dbName, @Nullable Class<? extends PropertyConverter<?, ?>> converterClass,
87+
@Nullable String dbName, @Nullable Class<? extends PropertyConverter> converterClass,
8788
@Nullable Class<?> customType) {
8889
this(entity, ordinal, id, type, name, isId, false, dbName, converterClass, customType);
8990
}
9091

92+
@SuppressWarnings("rawtypes") // Use raw type of PropertyConverter to allow users to supply a generic implementation.
9193
public Property(EntityInfo<ENTITY> entity, int ordinal, int id, Class<?> type, String name, boolean isId,
9294
boolean isVirtual, @Nullable String dbName,
93-
@Nullable Class<? extends PropertyConverter<?, ?>> converterClass, @Nullable Class<?> customType) {
95+
@Nullable Class<? extends PropertyConverter> converterClass, @Nullable Class<?> customType) {
9496
this.entity = entity;
9597
this.ordinal = ordinal;
9698
this.id = id;

0 commit comments

Comments
 (0)