awips2/edexOsgi/com.raytheon.uf.common.tafqueue/src/com/raytheon/uf/common/tafqueue/ServerResponse.java
Steve Harris 333fd9c64e Revert "12.6.1-10 baseline"
This reverts commit f8497470fc [formerly b33c5bdfcf] [formerly a2c0893d1a] [formerly 06f1c7b73c [formerly ddde63eee0] [formerly a2c0893d1a [formerly 5e2f5e9bc2b0559c3101cc0c3af708858e3b95d1]]].


Former-commit-id: 62cf6a9f92 [formerly b4b1f6975f] [formerly 25198a5cd6 [formerly 8cdb21fda317373a0dc95e5048716d0e31412ab4]]
Former-commit-id: 25198a5cd6
Former-commit-id: 8367fb50f5
2012-06-21 08:51:08 -05:00

110 lines
2.8 KiB
Java

/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.common.tafqueue;
import java.util.ArrayList;
import java.util.List;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
* The class is used to return responses back to CAVE for information requested
* on the taf_queue table.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 2, 2012 14715 rferrel Initial creation
*
* </pre>
*
* @author rferrel
* @version 1.0
*/
@DynamicSerialize
public class ServerResponse<T> implements ISerializableObject {
@DynamicSerializeElement
private List<String> messages;
@DynamicSerializeElement
boolean error;
@DynamicSerializeElement
private List<String> notifications;
@DynamicSerializeElement
private T payload;
public ServerResponse() {
this.messages = new ArrayList<String>();
this.notifications = new ArrayList<String>();
this.error = false;
}
public void addMessage(String message) {
messages.add(message);
}
public String toString() {
StringBuilder sb = new StringBuilder();
for (String message : messages) {
sb.append(message).append("\n");
}
return sb.toString();
}
public List<String> getMessages() {
return messages;
}
public void setMessages(List<String> messages) {
this.messages = messages;
}
public boolean isError() {
return error;
}
public void setError(boolean error) {
this.error = error;
}
public List<String> getNotifications() {
return notifications;
}
public void setNotifications(List<String> notifications) {
this.notifications = notifications;
}
public T getPayload() {
return payload;
}
public void setPayload(T payload) {
this.payload = payload;
}
}