com.cisco.trex.stateful.api.lowlevel.ASTFClientTemplate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of trex-java-sdk Show documentation
Show all versions of trex-java-sdk Show documentation
Java client SDK provides an implementation for TRex RPC APIs
package com.cisco.trex.stateful.api.lowlevel;
import com.google.gson.JsonObject;
/**
* Java implementation for TRex python sdk _ASTFClientTemplate class, the abstract Astf Client
* Template class
*/
abstract class ASTFClientTemplate extends ASTFTemplateBase {
private ASTFCluster astfCluster;
private ASTFIpGen iPGen;
/**
* construct
*
* @param iPGen
* @param astfCluster
* @param astfProgram
*/
public ASTFClientTemplate(ASTFIpGen iPGen, ASTFCluster astfCluster, ASTFProgram astfProgram) {
super(astfProgram);
this.iPGen = iPGen;
this.astfCluster = astfCluster == null ? new ASTFCluster() : astfCluster;
}
/**
* to json format
*
* @return JsonObject
*/
@Override
public JsonObject toJson() {
JsonObject json = super.toJson();
json.add("ip_gen", iPGen.toJson());
json.add("cluster", astfCluster.toJson());
return json;
}
}