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:
Michael Muller
2020-03-12 16:13:12 -04:00
committed by GitHub
parent 560bec1e83
commit 8a045aedd0
4 changed files with 7 additions and 7 deletions
@@ -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);
}