/** * Creates lazy caching key to store project-level service instance from {@link #getService(Project, Class)}. * * @param serviceClass Service class to create key for. * @param <T> Service class type. * @return Key instance. */ public static <T> NotNullLazyKey<T, Project> createLazyKey(@NotNull final Class<T> serviceClass) { return NotNullLazyKey.create("Service: " + serviceClass.getName(), new NotNullFunction<Project, T>() { @Override @NotNull public T fun(Project project) { return getService(project, serviceClass); } }); }
/** * Creates lazy caching key to store project-level service instance from {@link #getService(com.intellij.openapi.project.Project, Class)}. * * @param serviceClass Service class to create key for. * @param <T> Service class type. * @return Key instance. */ public static <T> NotNullLazyKey<T, Project> createLazyKey(@NotNull final Class<T> serviceClass) { return NotNullLazyKey.create("Service: " + serviceClass.getName(), new NotNullFunction<Project, T>() { @Override @NotNull public T fun(Project project) { return getService(project, serviceClass); } }); }
/** * Creates lazy caching key to store project-level service instance from {@link #getService(Project, Class)}. * * @param serviceClass Service class to create key for. * @param <T> Service class type. * @return Key instance. */ public static <T> NotNullLazyKey<T, Project> createLazyKey(@Nonnull final Class<T> serviceClass) { return NotNullLazyKey.create("Service: " + serviceClass.getName(), new NotNullFunction<Project, T>() { @Override @Nonnull public T fun(Project project) { return getService(project, serviceClass); } }); }