@Override
    public String toString() {
        if (isNonEmpty(version) || (namespace != null)) {
            StringBuilder builder = new StringBuilder(name);
            if (isNonEmpty(version)) {
                builder.append(':').append(version);
            }
            if (namespace != null) {
                builder.append(" in ").append(namespace.toString());
            }
            return builder.toString();
        } else {
            return name;
        }
    }
Code common to ComponentId and ComponentSpecification

@author Tony Vaagenes
component/src/main/java/com/yahoo/component/Spec.java