java.lang.Object
net.morimekta.config.Secret
Keeps a secret.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(SecretListener listener) Add a listener for secret changes.booleannet.morimekta.collect.util.Binarybyte[]getName()inthashCode()voidremoveListener(SecretListener listener) Remove a listener for secret changes.voidsetSecret(net.morimekta.collect.util.Binary secret) Set the secret to a new value.toString()
-
Constructor Details
-
Secret
Create a secret.- Parameters:
name- The name of the secret.env- If the secret comes from environment.value- The initial secret value.
-
-
Method Details
-
getName
- Returns:
- The secret name. The name is surrounded with '${}' if it comes from environment.
-
getAsString
- Returns:
- The secret value as string.
-
getAsBytes
public byte[] getAsBytes()- Returns:
- The secret value as bytes.
-
getAsBinary
public net.morimekta.collect.util.Binary getAsBinary()- Returns:
- The secret value as binary.
-
addListener
Add a listener for secret changes.- Parameters:
listener- The secret change listener.
-
removeListener
Remove a listener for secret changes.- Parameters:
listener- The secret change listener.
-
setSecret
public void setSecret(net.morimekta.collect.util.Binary secret) Set the secret to a new value. Should only be called fromSecretsManager, and is mainly visible for testing purposes.- Parameters:
secret- The secret value.
-
toString
-
equals
-
hashCode
public int hashCode()
-