class DefaultToolchain // should have been AbstractToolchain...
implements Toolchain, ToolchainPrivate {
    private final Logger logger;

    private String type;

    private Map<String, RequirementMatcher> provides = new HashMap<>();

    public static final String KEY_TYPE = "type"; // NOI18N

    private ToolchainModel model;

    /**
     *
     * @param model the model, must not be {@code null}
     * @param logger the logger, must not be {@code null}
     */
    protected DefaultToolchain(ToolchainModel model, Logger logger) {
        this.model = model;
        this.logger = logger;
    }

    /**
     *
     * @param model the model, must not be {@code null}
     * @param type the type
     * @param logger the logger, must not be {@code null}
     */
    protected DefaultToolchain(ToolchainModel model, String type, Logger logger) {
        this(model, logger);
        this.type = type;
    }

    @Override
    public final String getType() {
        return type != null ? type : model.getType();
    }

    @Override
    public final ToolchainModel getModel() {
        return model;
    }

    public final void addProvideToken(String type, RequirementMatcher matcher) {
        provides.put(type, matcher);
    }

    @Override
    public boolean matchesRequirements(Map<String, String> requirements) {
        for (Map.Entry<String, String> requirement : requirements.entrySet()) {
            String key = requirement.getKey();

            RequirementMatcher matcher = provides.get(key);

            if (matcher == null) {
                getLog().debug("Toolchain {} is missing required property: {}", this, key);
                return false;
            }
            if (!matcher.matches(requirement.getValue())) {
                getLog().debug("Toolchain {} doesn't match required property: {}", this, key);
                return false;
            }
        }
        return true;
    }

    protected Logger getLog() {
        return logger;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        if (this == obj) {
            return true;
        }

        if (!(obj instanceof DefaultToolchain)) {
            return false;
        }

        DefaultToolchain other = (DefaultToolchain) obj;

        if (!Objects.equals(type, other.type)) {
            return false;
        }

        Properties thisProvides = this.getModel().getProvides();
        Properties otherProvides = other.getModel().getProvides();

        return Objects.equals(thisProvides, otherProvides);
    }

    @Override
    public int hashCode() {
        int hashCode = (type == null) ? 0 : type.hashCode();

        if (this.getModel().getProvides() != null) {
            hashCode = 31 * hashCode + this.getModel().getProvides().hashCode();
        }
        return hashCode;
    }

    @Override
    public String toString() {<FILL_FUNCTION_BODY>}
}

        StringBuilder builder = new StringBuilder();
        builder.append("type:").append(getType());
        builder.append('{');

        Iterator<Map.Entry<String, RequirementMatcher>> providesIter =
                provides.entrySet().iterator();
        while (providesIter.hasNext()) {
            Map.Entry<String, RequirementMatcher> provideEntry = providesIter.next();
            builder.append(provideEntry.getKey()).append(" = ").append(provideEntry.getValue());
            if (providesIter.hasNext()) {
                builder.append(';');
            }
        }

        builder.append('}');

        return builder.toString();
    
<no_super_class>