public TnsName build() {
        StringBuilder sb = new StringBuilder();
        sb.append(tnsName);
        sb.append("=(DESCRIPTION = ");
        sb.append("(ADDRESS_LIST =");
        sb.append("(ADDRESS = (PROTOCOL = TCP)(HOST = ");
        sb.append(host);
        sb.append(")(PORT = ");
        sb.append(port);
        sb.append("))");
        sb.append(")");
        sb.append("(CONNECT_DATA =");

        if (null != serviceName && !serviceName.isEmpty()) {
            sb.append("(SERVICE_NAME = ");
            sb.append(serviceName);
        } else if (null != sid && !sid.isEmpty()) {
            sb.append("(SID = ");
            sb.append(sid);
        } else {
            throw new IllegalStateException("Either servicename or sid has to be entered.");
        }

        sb.append(")");
        sb.append(")");
        sb.append(")");
        return new TnsName(sb.toString().replaceAll("\\s", ""));

    }