import java.io.Serializable;
-
import com.google.gson.annotations.SerializedName;
public class PGRequest implements Serializable {
- /**
- *
- */
- private static final long serialVersionUID = -3283942659786236032L;
-
- @SerializedName("pg-streams")
- public PGStreams pgStreams;
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
- public PGRequest() {
- }
+ @SerializedName("pg-streams")
+ public PGStreams pgStreams;
+ public PGRequest() {
+ //required by author
+ }
}
public class PGStream implements Serializable {
- /**
- *
- */
- private static final long serialVersionUID = 5567635677419358210L;
-
- @SerializedName("id")
- public String streamId;
- @SerializedName("is-enabled")
- public String isEnabled;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5567635677419358210L;
- public PGStream() {
- }
+ @SerializedName("id")
+ public String streamId;
+ @SerializedName("is-enabled")
+ public String isEnabled;
+ public PGStream() {
+ //required by author
+ }
}
public class PGStreams implements Serializable {
- /**
- *
- */
- private static final long serialVersionUID = 5567635677419358210L;
-
- @SerializedName("pg-stream")
- public List<PGStream> pgStream= new LinkedList<PGStream>();
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5567635677419358210L;
- public PGStreams() {
- }
+ @SerializedName("pg-stream")
+ public List<PGStream> pgStream = new LinkedList<>();
+ public PGStreams() {
+ // required by author
+ }
}
public final class Serialization {
- private Serialization(){
- }
+ public static final Gson gsonPretty =
+ new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
- final static public Gson gsonPretty = new GsonBuilder().disableHtmlEscaping()
- .setPrettyPrinting()
-// .registerTypeAdapter(AAIQueryParameters.class, new notificationTypeAdapter())
- .create();
+ private Serialization() {}
}
import org.slf4j.LoggerFactory;
public class TestDemo {
- private static final Logger logger = LoggerFactory.getLogger(TestDemo.class);
- @Test
- public void test() {
- PGRequest request = new PGRequest();
- request.pgStreams = new PGStreams();
-
- PGStream pgStream;
- for(int i = 0; i < 5; i++){
- pgStream = new PGStream();
- pgStream.streamId = "fw_udp"+(i+1);
- pgStream.isEnabled = "true";
- request.pgStreams.pgStream.add(pgStream);
- }
-
- String body = Serialization.gsonPretty.toJson(request);
- logger.debug(body);
-
- // fail("Not yet implemented");
- }
+ private static final Logger logger = LoggerFactory.getLogger(TestDemo.class);
+
+ @Test
+ public void test() {
+ PGRequest request = new PGRequest();
+ request.pgStreams = new PGStreams();
+
+ PGStream pgStream;
+ for (int i = 0; i < 5; i++) {
+ pgStream = new PGStream();
+ pgStream.streamId = "fw_udp" + (i + 1);
+ pgStream.isEnabled = "true";
+ request.pgStreams.pgStream.add(pgStream);
+ }
+
+ String body = Serialization.gsonPretty.toJson(request);
+ logger.debug(body);
+
+ // fail("Not yet implemented");
+ }
}