本文整理汇总了Java中com.intellij.internal.statistic.persistence.SentUsagesPersistence类的典型用法代码示例。如果您正苦于以下问题:Java SentUsagesPersistence类的具体用法?Java SentUsagesPersistence怎么用?Java SentUsagesPersistence使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SentUsagesPersistence类属于com.intellij.internal.statistic.persistence包,在下文中一共展示了SentUsagesPersistence类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testPersistSentPatch
import com.intellij.internal.statistic.persistence.SentUsagesPersistence; //导入依赖的package包/类
public void testPersistSentPatch() {
final Map<GroupDescriptor, Set<UsageDescriptor>> allUsages = createDescriptors("g:a1:-1", "g2:a2:-2", "g2:a3:-3", "g:a2:-2", "g2:a1:-1", "g3:a1:13");
final SentUsagesPersistence usagesPersistence = new BasicSentUsagesPersistenceComponent();
Map<GroupDescriptor, Set<PatchedUsage>> patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence);
String result = StatisticsUploadAssistant.getStringPatch(patchedUsages, 500);
StatisticsUploadAssistant.persistSentPatch(result, usagesPersistence);
assertMapEquals(ConvertUsagesUtil.convertString(result), ConvertUsagesUtil.convertString("g:a2=-2,a1=-1;g2:a3=-3,a2=-2,a1=-1;g3:a1=13;"));
patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence);
result = StatisticsUploadAssistant.getStringPatch(patchedUsages, 500);
StatisticsUploadAssistant.persistSentPatch(result, usagesPersistence);
assertEquals("sent usages must be persisted", result.length(), 0);
assertEquals(allUsages.size(), usagesPersistence.getSentUsages().size());
}
示例2: getStringPatch
import com.intellij.internal.statistic.persistence.SentUsagesPersistence; //导入依赖的package包/类
@NotNull
public static String getStringPatch(@NotNull Set<String> disabledGroups,
@NotNull Project[] projects,
@NotNull SentUsagesPersistence usagesPersistence,
int maxSize) {
final Map<GroupDescriptor, Set<PatchedUsage>> patchedUsages = getPatchedUsages(disabledGroups, projects, usagesPersistence);
return getStringPatch(patchedUsages, maxSize);
}
示例3: getPatchedUsages
import com.intellij.internal.statistic.persistence.SentUsagesPersistence; //导入依赖的package包/类
@NotNull
public static Map<GroupDescriptor, Set<PatchedUsage>> getPatchedUsages(@NotNull Set<String> disabledGroups,
@NotNull Project[] projects,
@NotNull SentUsagesPersistence usagesPersistence) {
Map<GroupDescriptor, Set<PatchedUsage>> usages = new LinkedHashMap<GroupDescriptor, Set<PatchedUsage>>();
for (Project project : projects) {
final Map<GroupDescriptor, Set<UsageDescriptor>> allUsages = getAllUsages(project, disabledGroups);
final Map<GroupDescriptor, Set<UsageDescriptor>> sentUsages = filterDisabled(disabledGroups, usagesPersistence.getSentUsages());
usages.putAll(getPatchedUsages(allUsages, sentUsages));
}
return usages;
}
示例4: testPersistSentPatchWithRestrictedSize
import com.intellij.internal.statistic.persistence.SentUsagesPersistence; //导入依赖的package包/类
public void testPersistSentPatchWithRestrictedSize() {
int size = 15;
final Map<GroupDescriptor, Set<UsageDescriptor>> allUsages = createDescriptors("g:a1:-1", "g2:a2:-2", "g2:a3:-3", "g:a2:-2", "g3:a1:-1", "g3:a2:13");
final SentUsagesPersistence usagesPersistence = new BasicSentUsagesPersistenceComponent();
Map<GroupDescriptor, Set<PatchedUsage>> patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence);
String first = StatisticsUploadAssistant.getStringPatch(patchedUsages, size);
StatisticsUploadAssistant.persistSentPatch(first, usagesPersistence);
assertTrue(first.length() <= size);
assertMapEquals(ConvertUsagesUtil.convertString(first), ConvertUsagesUtil.convertString("g:a1=-1,a2=-2"));
patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence);
String second = StatisticsUploadAssistant.getStringPatch(patchedUsages, size);
StatisticsUploadAssistant.persistSentPatch(second, usagesPersistence);
assertTrue(second.length() <= size);
assertFalse(second.contains(first));
assertMapEquals(ConvertUsagesUtil.convertString(second), ConvertUsagesUtil.convertString("g2:a2=-2,a3=-3"));
patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence);
String third = StatisticsUploadAssistant.getStringPatch(patchedUsages, size);
StatisticsUploadAssistant.persistSentPatch(third, usagesPersistence);
assertTrue(third.length() <= size);
assertFalse(third.contains(first));
assertFalse(third.contains(second));
assertMapEquals(ConvertUsagesUtil.convertString(third), ConvertUsagesUtil.convertString("g3:a1=-1,a2=13"));
patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence);
assertEquals(patchedUsages.size(), 0);
assertEquals(allUsages.size(), usagesPersistence.getSentUsages().size());
}
示例5: getStringPatch
import com.intellij.internal.statistic.persistence.SentUsagesPersistence; //导入依赖的package包/类
@Nonnull
public static String getStringPatch(@Nonnull Set<String> disabledGroups,
@Nonnull Project[] projects,
@Nonnull SentUsagesPersistence usagesPersistence,
int maxSize) {
final Map<GroupDescriptor, Set<PatchedUsage>> patchedUsages = getPatchedUsages(disabledGroups, projects, usagesPersistence);
return getStringPatch(patchedUsages, maxSize);
}
示例6: getPatchedUsages
import com.intellij.internal.statistic.persistence.SentUsagesPersistence; //导入依赖的package包/类
@Nonnull
public static Map<GroupDescriptor, Set<PatchedUsage>> getPatchedUsages(@Nonnull Set<String> disabledGroups,
@Nonnull Project[] projects,
@Nonnull SentUsagesPersistence usagesPersistence) {
Map<GroupDescriptor, Set<PatchedUsage>> usages = new LinkedHashMap<GroupDescriptor, Set<PatchedUsage>>();
for (Project project : projects) {
final Map<GroupDescriptor, Set<UsageDescriptor>> allUsages = getAllUsages(project, disabledGroups);
final Map<GroupDescriptor, Set<UsageDescriptor>> sentUsages = filterDisabled(disabledGroups, usagesPersistence.getSentUsages());
usages.putAll(getPatchedUsages(allUsages, sentUsages));
}
return usages;
}
示例7: isSendAllowed
import com.intellij.internal.statistic.persistence.SentUsagesPersistence; //导入依赖的package包/类
public static boolean isSendAllowed(final SentUsagesPersistence settings) {
return settings != null && settings.isAllowed();
}
示例8: isSendAllowed
import com.intellij.internal.statistic.persistence.SentUsagesPersistence; //导入依赖的package包/类
public static boolean isSendAllowed(final SentUsagesPersistence settings) {
return settings != null && settings.isAllowed();
}
示例9: persistSentPatch
import com.intellij.internal.statistic.persistence.SentUsagesPersistence; //导入依赖的package包/类
public static void persistSentPatch(@NotNull String patchStr, @NotNull SentUsagesPersistence persistenceComponent) {
Map<GroupDescriptor, Set<PatchedUsage>> patchedUsages = mapToPatchedUsagesMap(ConvertUsagesUtil.convertString(patchStr));
if (patchedUsages.size() > 0) persistenceComponent.persistPatch(patchedUsages);
}
示例10: persistSentPatch
import com.intellij.internal.statistic.persistence.SentUsagesPersistence; //导入依赖的package包/类
public static void persistSentPatch(@Nonnull String patchStr, @Nonnull SentUsagesPersistence persistenceComponent) {
Map<GroupDescriptor, Set<PatchedUsage>> patchedUsages = mapToPatchedUsagesMap(ConvertUsagesUtil.convertString(patchStr));
if (patchedUsages.size() > 0) persistenceComponent.persistPatch(patchedUsages);
}