com.github.nagyesta.lowkeyvault.mapper.v7_2.secret.SecretEntityToV72PropertiesModelConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lowkey-vault-app Show documentation
Show all versions of lowkey-vault-app Show documentation
Assembled application of Lowkey Vault.
package com.github.nagyesta.lowkeyvault.mapper.v7_2.secret;
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.SecretConverterRegistry;
import com.github.nagyesta.lowkeyvault.model.v7_2.secret.SecretPropertiesModel;
import com.github.nagyesta.lowkeyvault.service.secret.ReadOnlyKeyVaultSecretEntity;
import com.github.nagyesta.lowkeyvault.service.secret.id.VersionedSecretEntityId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.lang.NonNull;
import java.net.URI;
import java.util.SortedSet;
public class SecretEntityToV72PropertiesModelConverter
extends BasePropertiesModelConverter
implements AliasAwareConverter {
private final SecretConverterRegistry registry;
@Autowired
public SecretEntityToV72PropertiesModelConverter(@lombok.NonNull final SecretConverterRegistry registry) {
this.registry = registry;
}
@Override
public void afterPropertiesSet() {
registry.registerPropertiesConverter(this);
}
@Override
@NonNull
public SecretPropertiesModel convert(@NonNull final ReadOnlyKeyVaultSecretEntity source, @NonNull final URI vaultUri) {
return mapCommonFields(source, new SecretPropertiesModel());
}
@Override
public SortedSet supportedVersions() {
return ApiVersionAware.ALL_VERSIONS;
}
}