public static JobClient buildByProperties(JobClientProperties properties) {
        properties.checkProperties();

        JobClient jobClient;
        if (properties.isUseRetryClient()) {
            jobClient = new RetryJobClient();
        } else {
            jobClient = new JobClient();
        }
        jobClient.setRegistryAddress(properties.getRegistryAddress());
        if (StringUtils.isNotEmpty(properties.getClusterName())) {
            jobClient.setClusterName(properties.getClusterName());
        }
        if (StringUtils.isNotEmpty(properties.getIdentity())) {
            jobClient.setIdentity(properties.getIdentity());
        }
        if (StringUtils.isNotEmpty(properties.getNodeGroup())) {
            jobClient.setNodeGroup(properties.getNodeGroup());
        }
        if (StringUtils.isNotEmpty(properties.getDataPath())) {
            jobClient.setDataPath(properties.getDataPath());
        }
        if (StringUtils.isNotEmpty(properties.getBindIp())) {
            jobClient.setBindIp(properties.getBindIp());
        }
        if (CollectionUtils.isNotEmpty(properties.getConfigs())) {
            for (Map.Entry<String, String> entry : properties.getConfigs().entrySet()) {
                jobClient.addConfig(entry.getKey(), entry.getValue());
            }
        }
        return jobClient;
    }
@author Robert HG (254963746@qq.com) on 4/21/16.
lts-jobclient/src/main/java/com/github/ltsopensource/jobclient/JobClientBuilder.java