Add missing @Nullable annotations to ForeignKeyIndex load methods

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138782186
This commit is contained in:
mcilwain 2016-11-10 11:16:58 -08:00 committed by Ben McIlwain
parent 780a5add78
commit 07a6e55f82

View file

@ -33,6 +33,7 @@ import google.registry.model.contact.ContactResource;
import google.registry.model.domain.DomainResource; import google.registry.model.domain.DomainResource;
import google.registry.model.host.HostResource; import google.registry.model.host.HostResource;
import java.util.Map; import java.util.Map;
import javax.annotation.Nullable;
import org.joda.time.DateTime; import org.joda.time.DateTime;
/** /**
@ -128,6 +129,7 @@ public abstract class ForeignKeyIndex<E extends EppResource> extends BackupGroup
* @param now the current logical time to use when checking for soft deletion of the foreign key * @param now the current logical time to use when checking for soft deletion of the foreign key
* index * index
*/ */
@Nullable
public static <E extends EppResource> Key<E> loadAndGetKey( public static <E extends EppResource> Key<E> loadAndGetKey(
Class<E> clazz, String foreignKey, DateTime now) { Class<E> clazz, String foreignKey, DateTime now) {
ForeignKeyIndex<E> index = load(clazz, foreignKey, now); ForeignKeyIndex<E> index = load(clazz, foreignKey, now);
@ -140,6 +142,7 @@ public abstract class ForeignKeyIndex<E extends EppResource> extends BackupGroup
* *
* <p>This will return null if the {@link ForeignKeyIndex} doesn't exist or has been soft deleted. * <p>This will return null if the {@link ForeignKeyIndex} doesn't exist or has been soft deleted.
*/ */
@Nullable
public static <E extends EppResource> ForeignKeyIndex<E> load( public static <E extends EppResource> ForeignKeyIndex<E> load(
Class<E> clazz, String foreignKey, DateTime now) { Class<E> clazz, String foreignKey, DateTime now) {
return load(clazz, ImmutableList.of(foreignKey), now).get(foreignKey); return load(clazz, ImmutableList.of(foreignKey), now).get(foreignKey);