com.github.nagyesta.lowkeyvault.service.secret.impl.KeyVaultSecretEntity 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.service.secret.impl;
import com.github.nagyesta.lowkeyvault.service.common.impl.KeyVaultBaseEntity;
import com.github.nagyesta.lowkeyvault.service.secret.ReadOnlyKeyVaultSecretEntity;
import com.github.nagyesta.lowkeyvault.service.secret.id.VersionedSecretEntityId;
import com.github.nagyesta.lowkeyvault.service.vault.VaultFake;
import lombok.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
public class KeyVaultSecretEntity extends KeyVaultBaseEntity implements ReadOnlyKeyVaultSecretEntity {
private String value;
private final String contentType;
private final VersionedSecretEntityId id;
public KeyVaultSecretEntity(@NonNull final VersionedSecretEntityId id,
@org.springframework.lang.NonNull final VaultFake vault,
@org.springframework.lang.NonNull final String value,
@Nullable final String contentType) {
super(vault);
Assert.hasText(value, "Value must not be null or blank.");
this.id = id;
this.value = value;
this.contentType = contentType;
}
@Override
public String getValue() {
return value;
}
public void setValue(final String value) {
this.value = value;
}
@Override
public String getContentType() {
return contentType;
}
@Override
public VersionedSecretEntityId getId() {
return id;
}
}