public static SignedIdentityDocumentEntity toSignedIdentityDocumentEntity(SignedIdentityDocument model) {
        if (model instanceof V4SignedIdentityDocument defaultModel) {
            return new V4SignedIdentityDocumentEntity(defaultModel.signature(),
                    defaultModel.v4SigningKeyVersion(),
                    defaultModel.documentVersion(),
                    defaultModel.data());
        } else if (model instanceof V5SignedIdentityDocument defaultModel){
                return new V5SignedIdentityDocumentEntity(defaultModel.signature(),
                        defaultModel.signingKeyVersion(),
                        defaultModel.documentVersion(),
                        defaultModel.data());
        } else {
            throw new IllegalArgumentException("Unsupported model type: " + model.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