@Override
    public CompletableFuture<PlcWriteResponse> write(PlcWriteRequest writeRequest) {
        PlcWriteRequest filteredWriteRequest = getFilteredWriteRequest((DefaultPlcWriteRequest) writeRequest);
        return internalWrite(filteredWriteRequest)
            .thenApply(filteredWriteResponse -> {
                // Shortcut for the case that all tags were valid.
                if(writeRequest.getNumberOfTags() == filteredWriteRequest.getNumberOfTags()) {
                    return filteredWriteResponse;
                }

                Map<String, PlcResponseCode> values = new HashMap<>();
                for (String tagName : writeRequest.getTagNames()) {
                    // If the tag was correct, then we expect a response in the response.
                    if(filteredWriteRequest.getTagResponseCode(tagName) != null) {
                        values.put(tagName, filteredWriteResponse.getResponseCode(tagName));
                    }
                    // In all other cases forward the initial error to the final output.
                    else {
                        values.put(tagName, writeRequest.getTagResponseCode(tagName));
                    }
                }
                return new DefaultPlcWriteResponse(writeRequest, values);
            });
    }
Base class for implementing connections.
Per default, all operations (read, write, subscribe) are unsupported.
Concrete implementations should override the methods indicating connection capabilities
and for obtaining respective request builders.
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/AbstractPlcConnection.java