@Test public void testResolveMaxAgeMPlusConflicts() { specificPattern = new PatternCacheControl("***", "max-age=m+200"); ConflictResolverUtils.resolveConflicts(specificPattern, generalPattern); directives = new HashMap<>(); directives.put(Directive.MAX_AGE_MPLUS, "200"); assertEquals(specificPattern.getDirectives(), directives); }
public static void resolveConflicts(PatternCacheControl specificPattern, PatternCacheControl generalPattern) { for (Entry<Directive, String> entry : generalPattern.getDirectives().entrySet()) { Directive generalDirective = entry.getKey(); String generalValue = entry.getValue(); if (generalValue == EMPTY_STRING_VALUE) { specificPattern.setDirective(generalDirective, EMPTY_STRING_VALUE); } else { resolveValueConflicts(generalDirective, generalValue, specificPattern); } } }
ConflictResolverUtils { public static void resolveConflicts(PatternCacheControl specificPattern, PatternCacheControl generalPattern) { for (Entry<Directive, String> entry : generalPattern.getDirectives().entrySet()) { Directive generalDirective = entry.getKey(); String generalValue = entry.getValue(); if (generalValue == EMPTY_STRING_VALUE) { specificPattern.setDirective(generalDirective, EMPTY_STRING_VALUE); } else { resolveValueConflicts(generalDirective, generalValue, specificPattern); } } } }
ConflictResolverUtils { public static void resolveConflicts(PatternCacheControl specificPattern, PatternCacheControl generalPattern) { for (Entry<Directive, String> entry : generalPattern.getDirectives().entrySet()) { Directive generalDirective = entry.getKey(); String generalValue = entry.getValue(); if (generalValue == EMPTY_STRING_VALUE) { specificPattern.setDirective(generalDirective, EMPTY_STRING_VALUE); } else { resolveValueConflicts(generalDirective, generalValue, specificPattern); } } } private  ConflictResolverUtils(); }
ConflictResolverUtils { public static void resolveConflicts(PatternCacheControl specificPattern, PatternCacheControl generalPattern) { for (Entry<Directive, String> entry : generalPattern.getDirectives().entrySet()) { Directive generalDirective = entry.getKey(); String generalValue = entry.getValue(); if (generalValue == EMPTY_STRING_VALUE) { specificPattern.setDirective(generalDirective, EMPTY_STRING_VALUE); } else { resolveValueConflicts(generalDirective, generalValue, specificPattern); } } } private  ConflictResolverUtils(); static void resolveConflicts(PatternCacheControl specificPattern, PatternCacheControl generalPattern); }
ConflictResolverUtils { public static void resolveConflicts(PatternCacheControl specificPattern, PatternCacheControl generalPattern) { for (Entry<Directive, String> entry : generalPattern.getDirectives().entrySet()) { Directive generalDirective = entry.getKey(); String generalValue = entry.getValue(); if (generalValue == EMPTY_STRING_VALUE) { specificPattern.setDirective(generalDirective, EMPTY_STRING_VALUE); } else { resolveValueConflicts(generalDirective, generalValue, specificPattern); } } } private  ConflictResolverUtils(); static void resolveConflicts(PatternCacheControl specificPattern, PatternCacheControl generalPattern);  }