@Test public void testPatternCacheControl() { PatternCacheControl patternCacheControl = new PatternCacheControl(PATTERN, "max-age = 100, public"); assertEquals(PATTERN, patternCacheControl.getPattern()); Map<Directive, String> directives = new HashMap<>(); directives.put(Directive.PUBLIC, EMPTY_STRING_VALUE); directives.put(Directive.MAX_AGE, "100"); assertEquals(patternCacheControl.getDirectives(), directives); patternCacheControl.setDirective(Directive.NO_CACHE, EMPTY_STRING_VALUE); assertEquals(patternCacheControl.getDirectiveValue(Directive.NO_CACHE), EMPTY_STRING_VALUE); assertTrue(patternCacheControl.hasDirective(Directive.PUBLIC)); assertFalse(patternCacheControl.hasDirective(Directive.NO_TRANSFORM)); patternCacheControl.incrementMatchingPatternCount(); assertEquals(patternCacheControl.getMatchingPatternCount(), 1); }
public PatternCacheControl(String pattern, String directives) { this.pattern = pattern; setDirectiveList(directives); }
PatternCacheControl { public PatternCacheControl(String pattern, String directives) { this.pattern = pattern; setDirectiveList(directives); } }
PatternCacheControl { public PatternCacheControl(String pattern, String directives) { this.pattern = pattern; setDirectiveList(directives); } PatternCacheControl(String pattern, String directives);  PatternCacheControl(String pattern, Directive directive, String value); }
PatternCacheControl { public PatternCacheControl(String pattern, String directives) { this.pattern = pattern; setDirectiveList(directives); } PatternCacheControl(String pattern, String directives);  PatternCacheControl(String pattern, Directive directive, String value); String getPattern(); Map<Directive, String> getDirectives(); int getMatchingPatternCount(); void setDirective(Directive directive, String value); String getDirectiveValue(Directive name); boolean hasDirective(Directive name); void incrementMatchingPatternCount(); }
PatternCacheControl { public PatternCacheControl(String pattern, String directives) { this.pattern = pattern; setDirectiveList(directives); } PatternCacheControl(String pattern, String directives);  PatternCacheControl(String pattern, Directive directive, String value); String getPattern(); Map<Directive, String> getDirectives(); int getMatchingPatternCount(); void setDirective(Directive directive, String value); String getDirectiveValue(Directive name); boolean hasDirective(Directive name); void incrementMatchingPatternCount();  }