public static SignedIdentityDocument toSignedIdentityDocument(SignedIdentityDocumentEntity entity) {
        if (entity instanceof V4SignedIdentityDocumentEntity docEntity) {
            return new V4SignedIdentityDocument(docEntity.signature(),
                    docEntity.signingKeyVersion(),
                    docEntity.documentVersion(),
                    docEntity.data());
        } else if (entity instanceof V5SignedIdentityDocumentEntity docEntity) {
            return new V5SignedIdentityDocument(docEntity.signature(),
                    docEntity.signingKeyVersion(),
                    docEntity.documentVersion(),
                    docEntity.data());
        } else {
            throw new IllegalArgumentException("Unknown signed identity document type: " + entity.getClass().getName());
        }
    }
Utility class for mapping objects model types and their Jackson binding versions.

@author bjorncs
@author mortent
vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/EntityBindingsMapper.java