class UserCredentialVersion extends CredentialVersion {

  @Override
  public StringGenerationParameters getGenerationParameters() {
    final String parameterJson = getEncryptor().decrypt(delegate.getEncryptedGenerationParameters());

    if (parameterJson == null) {
      return null;
    }

    try {
      final StringGenerationParameters generationParameters = jsonObjectMapper
        .deserializeBackwardsCompatibleValue(parameterJson, StringGenerationParameters.class);

      final String password = this.password == null ? getPassword() : this.password;

      generationParameters.setLength(password.length());

      return generationParameters;
    } catch (final IOException e) {
      throw new RuntimeException(e);
    }
  }

  public  UserCredentialVersion(final UserCredentialVersionData delegate);
  public  UserCredentialVersion(final String name);
  public  UserCredentialVersion(
    final UserCredentialValue userValue,
    final String name,
    final StringGenerationParameters generationParameters,
    final Encryptor encryptor
  );

}