class FromInstruction {

    @Override
    public String toString() {
        StringBuilder stringBuilder = new StringBuilder(NAME);
        stringBuilder.append(" ");
        stringBuilder.append(baseImageName);
        if (hasTag()) {
            stringBuilder.append(String.format(":%s", tag.trim()));
        }
        for (String part : additionalParts) {
            if (StringUtils.isNotBlank(part)) {
                stringBuilder.append(String.format(" %s", part.trim()));
            }
        }

        if (hasComments()) {
            stringBuilder.append(String.format(" %s", comments));
        }

        return stringBuilder.toString();
    }

    public  FromInstruction(String fromInstructionLine);
    private  FromInstruction(String baseImageName, String tag, List<String> additionalParts, String comments);

}