mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Turn Flow into an interface and inject all its fields
This concludes your flow flattening experience. Please fill out a flow flattening satisfaction survey before exiting. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=137903095
This commit is contained in:
parent
82b0bff9b5
commit
053538b1b5
49 changed files with 630 additions and 569 deletions
|
@ -14,10 +14,11 @@
|
|||
|
||||
package google.registry.model.poll;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import google.registry.model.Buildable;
|
||||
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;
|
||||
|
@ -40,32 +41,34 @@ public class MessageQueueInfo extends ImmutableObject {
|
|||
@XmlAttribute(name = "id")
|
||||
String messageId;
|
||||
|
||||
public DateTime getQueueDate() {
|
||||
return queueDate;
|
||||
}
|
||||
/** A builder for constructing a {@link MessageQueueInfo}, since it's immutable. */
|
||||
public static class Builder extends Buildable.Builder<MessageQueueInfo> {
|
||||
public Builder setQueueDate(DateTime queueDate) {
|
||||
getInstance().queueDate = queueDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
public Builder setMsg(String msg) {
|
||||
getInstance().msg = msg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getQueueLength() {
|
||||
return queueLength;
|
||||
}
|
||||
public Builder setQueueLength(int queueLength) {
|
||||
checkArgument(queueLength >= 0);
|
||||
getInstance().queueLength = queueLength;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMessageId() {
|
||||
return messageId;
|
||||
}
|
||||
public Builder setMessageId(String messageId) {
|
||||
getInstance().messageId = messageId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static MessageQueueInfo create(
|
||||
@Nullable DateTime queueDate,
|
||||
@Nullable String msg,
|
||||
Integer queueLength,
|
||||
String messageId) {
|
||||
MessageQueueInfo instance = new MessageQueueInfo();
|
||||
instance.queueDate = queueDate;
|
||||
instance.msg = msg;
|
||||
instance.queueLength = checkNotNull(queueLength);
|
||||
instance.messageId = checkNotNull(messageId);
|
||||
return instance;
|
||||
@Override
|
||||
public MessageQueueInfo build() {
|
||||
checkNotNull(getInstance().messageId);
|
||||
checkNotNull(getInstance().queueLength);
|
||||
return super.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue