class PrivateKeyTypeAdapter extends XmlAdapter<String, PrivateKeyType> {

    @Override
    public String marshal(final PrivateKeyType v) {
        return MAPPING
            .entrySet()
            .stream()
            .filter(e -> e.getValue() == v)
            .map(Map.Entry::getKey)
            .findAny()
            .orElse(null);
    }

}