com.kucoin.sdk.websocket.RandomChooseStrategy Maven / Gradle / Ivy
The newest version!
/**
* Copyright 2019 Mek Global Limited.
*/
package com.kucoin.sdk.websocket;
import com.kucoin.sdk.model.InstanceServer;
import java.util.List;
import java.util.Random;
/**
* Created by chenshiwei on 2019/1/24.
*/
public class RandomChooseStrategy implements ChooseServerStrategy {
private final Random random = new Random();
@Override
public InstanceServer choose(List servers) {
return servers.get(random.nextInt(servers.size()));
}
}