class OnboardingStateContributor implements StateContributor {

  @Nullable
  @Override
  public Map<String, Object> getState() {
    //cache the onboarding flag, once it's false there is no longer a need to check anymore
    needsOnboarding = needsOnboarding && onboardingConfiguration.isEnabled() && onboardingManager.needsOnboarding();

    HashMap<String, Object> properties = new HashMap<>();

    if (needsOnboarding) {
      properties.put("onboarding.required", true);
    }

    if (adminPasswordFileManager.exists()) {
      properties.put("admin.password.file", adminPasswordFileManager.getPath());
    }

    return properties.isEmpty() ? null : properties;
  }

  @Inject public  OnboardingStateContributor(final OnboardingConfiguration onboardingConfiguration,
                                    final OnboardingManager onboardingManager,
                                    final AdminPasswordFileManager adminPasswordFileManager);

}