All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.nagyesta.lowkeyvault.mapper.v7_3.certificate.CertificateEntityToV73PropertiesModelConverter Maven / Gradle / Ivy

There is a newer version: 2.5.81
Show newest version
package com.github.nagyesta.lowkeyvault.mapper.v7_3.certificate;

import com.github.nagyesta.lowkeyvault.context.ApiVersionAware;
import com.github.nagyesta.lowkeyvault.mapper.common.AliasAwareConverter;
import com.github.nagyesta.lowkeyvault.mapper.common.BasePropertiesModelConverter;
import com.github.nagyesta.lowkeyvault.mapper.common.registry.CertificateConverterRegistry;
import com.github.nagyesta.lowkeyvault.model.v7_3.certificate.CertificatePropertiesModel;
import com.github.nagyesta.lowkeyvault.service.certificate.ReadOnlyKeyVaultCertificateEntity;
import com.github.nagyesta.lowkeyvault.service.certificate.id.VersionedCertificateEntityId;
import org.springframework.lang.NonNull;

import java.net.URI;
import java.util.SortedSet;

public class CertificateEntityToV73PropertiesModelConverter
        extends BasePropertiesModelConverter
        implements AliasAwareConverter {

    private final CertificateConverterRegistry registry;

    public CertificateEntityToV73PropertiesModelConverter(@lombok.NonNull final CertificateConverterRegistry registry) {
        this.registry = registry;
    }

    @Override
    public void afterPropertiesSet() {
        registry.registerPropertiesConverter(this);
    }

    @Override
    @NonNull
    public CertificatePropertiesModel convert(
            @org.springframework.lang.NonNull final ReadOnlyKeyVaultCertificateEntity source,
            @org.springframework.lang.NonNull final URI vaultUri) {
        return mapCommonFields(source, new CertificatePropertiesModel());
    }

    @Override
    public SortedSet supportedVersions() {
        return ApiVersionAware.V7_3_AND_LATER;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy