void init(JsonObject config){
  period=config.getLong("period",3000L);
  variation=config.getInteger("variation",100);
  name=config.getString("name");
  Objects.requireNonNull(name);
  symbol=config.getString("symbol",name);
  stocks=config.getInteger("volume",10000);
  price=config.getDouble("price",100.0);
  value=price;
  ask=price + random.nextInt(variation / 2);
  bid=price + random.nextInt(variation / 2);
  share=stocks / 2;
}

void init ( JsonObject config ) { period = config . getLong ( "period" , 3000L ) ; variation = config . getInteger ( "variation" , 100 ) ; name = config . getString ( "name" ) ; Objects . requireNonNull ( name ) ; symbol = config . getString ( "symbol" , name ) ; stocks = config . getInteger ( "volume" , 10000 ) ; price = config . getDouble ( "price" , 100.0 ) ; value = price ; ask = price + random . nextInt ( variation / 2 ) ; bid = price + random . nextInt ( variation / 2 ) ; share = stocks / 2 ; }
read the configuration and set the initial values .
