コード例 #1
0
  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);
  }
コード例 #2
0
  @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;
  }
コード例 #3
0
 public static boolean isSendAllowed(final SentUsagesPersistence settings) {
   return settings != null && settings.isAllowed();
 }
コード例 #4
0
 @NotNull
 public static Map<GroupDescriptor, Set<PatchedUsage>> getPatchedUsages(
     @NotNull final Map<GroupDescriptor, Set<UsageDescriptor>> allUsages,
     @NotNull SentUsagesPersistence usagesPersistence) {
   return getPatchedUsages(allUsages, usagesPersistence.getSentUsages());
 }