com.intellij.internal.statistic.persistence.ApplicationStatisticsPersistence Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-impl Show documentation
Show all versions of platform-impl Show documentation
A packaging of the IntelliJ Community Edition platform-impl library.
This is release number 1 of trunk branch 142.
The newest version!
package com.intellij.internal.statistic.persistence;
import com.intellij.internal.statistic.beans.GroupDescriptor;
import com.intellij.openapi.project.Project;
import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import java.util.Map;
public abstract class ApplicationStatisticsPersistence {
private final Map> myApplicationData = new THashMap>();
public void persistUsages(@NotNull GroupDescriptor groupDescriptor, @NotNull Project project, @NotNull CollectedUsages usageDescriptors) {
if (!myApplicationData.containsKey(groupDescriptor)) {
myApplicationData.put(groupDescriptor, new THashMap());
}
myApplicationData.get(groupDescriptor).put(project.getName(), usageDescriptors);
}
@NotNull
public Map getApplicationData(@NotNull GroupDescriptor groupDescriptor) {
if (!myApplicationData.containsKey(groupDescriptor)) {
myApplicationData.put(groupDescriptor, new THashMap());
}
return myApplicationData.get(groupDescriptor);
}
@NotNull
public Map> getApplicationData() {
return myApplicationData;
}
}