mirror of
https://github.com/google/nomulus
synced 2026-09-12 02:56:26 +00:00
Disambiguate naming of VKey.create() overloads (#513)
* Disambiguate naming of VKey.create() overloads It was discovered in the course of trying to convert the larger codebase to VKey.create() calls that method overloading isn't a very effective discriminator in cases where "Object" is one of the distinguishing argument types:-) Convert the two specialized create() methods to createOfy() and createSql() so that (at least in the former case) we'll get a compile-time error if we aim to create a VKey for an Ofy key from an object of the incorrect type.
This commit is contained in:
@@ -43,11 +43,11 @@ public class VKey<T> extends ImmutableObject {
|
||||
return new VKey(kind, ofyKey, primaryKey);
|
||||
}
|
||||
|
||||
public static <T> VKey<T> create(Class<? extends T> kind, Object primaryKey) {
|
||||
public static <T> VKey<T> createSql(Class<? extends T> kind, Object primaryKey) {
|
||||
return new VKey(kind, null, primaryKey);
|
||||
}
|
||||
|
||||
public static <T> VKey<T> create(
|
||||
public static <T> VKey<T> createOfy(
|
||||
Class<? extends T> kind, com.googlecode.objectify.Key<T> ofyKey) {
|
||||
return new VKey(kind, ofyKey, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user