class EncryptedStringResolver {

    public String resolve(final String textToDecrypt) {

        if (PropertyValueEncryptionUtils.isEncryptedValue(textToDecrypt)) {

            if (!isPasswordSet) {
                encryptor.setPasswordCharArray(
                        ConfigSecretReader.readSecretFromFile().orElseGet(ConfigSecretReader::readSecretFromConsole));
                isPasswordSet = true;
            }

            return PropertyValueEncryptionUtils.decrypt(textToDecrypt, encryptor);
        }

        LOGGER.warn(
                "Some sensitive values are being given as unencrypted plain text in config. "
                        + "Please note this is NOT recommended for production environment.");

        return textToDecrypt;
    }

    public  EncryptedStringResolver();

}