Replace deprecated "assignableFrom" with Guava 20 "subtypeOf"

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146161987
This commit is contained in:
cgoldfeder 2017-01-31 13:57:35 -08:00 committed by Ben McIlwain
parent c50a76294f
commit 0a2622c6ab

View file

@ -14,8 +14,8 @@
package google.registry.model; package google.registry.model;
import static com.google.common.base.Predicates.assignableFrom;
import static com.google.common.base.Predicates.or; import static com.google.common.base.Predicates.or;
import static com.google.common.base.Predicates.subtypeOf;
import com.google.common.base.Function; import com.google.common.base.Function;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
@ -61,7 +61,7 @@ public final class SchemaVersion {
*/ */
public static String getSchema() { public static String getSchema() {
return FluentIterable.from(getAllPersistedTypes()) return FluentIterable.from(getAllPersistedTypes())
.filter(or(assignableFrom(Enum.class), assignableFrom(ImmutableObject.class))) .filter(or(subtypeOf(Enum.class), subtypeOf(ImmutableObject.class)))
.transform(new Function<Class<?>, String>() { .transform(new Function<Class<?>, String>() {
@Override @Override
public String apply(Class<?> clazz) { public String apply(Class<?> clazz) {