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

com.ijson.config.base.ProcessInfo Maven / Gradle / Ivy

package com.ijson.config.base;

import com.google.common.base.Strings;
import com.google.common.collect.Lists;

import java.util.List;

/**
 * @author *
 */
public class ProcessInfo {
    private String path;
    private String name;
    private String profile;
    private String ip;
    private String port;

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProfile() {
        return profile;
    }

    public void setProfile(String profile) {
        this.profile = profile;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public List orderedPath() {
        List paths = Lists.newArrayList();
        if (!Strings.isNullOrEmpty(ip)) {
            if (!Strings.isNullOrEmpty(port)) {
                paths.add(ip + ':' + port);
            }
            paths.add(ip);
        }
        if (!Strings.isNullOrEmpty(profile)) {
            paths.add(profile);
        }
        if (!Strings.isNullOrEmpty(name)) {
            paths.add(name);
        }
        return paths;
    }

    @Override
    public String toString() {
        return "ProcessInfo{" + "path=" + path + ", name=" + name + ", profile=" + profile + ", ip=" + ip + ", port=" + port
                + '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy