Handle nullness properly in some message/flow/poll code

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127543268
This commit is contained in:
mcilwain 2016-07-15 08:39:25 -07:00 committed by Ben McIlwain
parent eed319990a
commit 71ab4a648b
7 changed files with 27 additions and 10 deletions

View file

@ -14,7 +14,10 @@
package google.registry.model.poll;
import static com.google.common.base.Preconditions.checkNotNull;
import google.registry.model.ImmutableObject;
import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import org.joda.time.DateTime;
@ -54,15 +57,15 @@ public class MessageQueueInfo extends ImmutableObject {
}
public static MessageQueueInfo create(
DateTime queueDate,
String msg,
@Nullable DateTime queueDate,
@Nullable String msg,
Integer queueLength,
String messageId) {
MessageQueueInfo instance = new MessageQueueInfo();
instance.queueDate = queueDate;
instance.msg = msg;
instance.queueLength = queueLength;
instance.messageId = messageId;
instance.queueLength = checkNotNull(queueLength);
instance.messageId = checkNotNull(messageId);
return instance;
}
}