All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cisco.trex.stateful.api.lowlevel.ASTFClientTemplate Maven / Gradle / Ivy

There is a newer version: 1.69
Show newest version
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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy