ServerCacheControl extends CacheControl { public boolean immutable() { return immutable; } ServerCacheControl(boolean noCache, boolean noStore, boolean noTransform, long maxAgeSeconds,
                       boolean cachePublic, boolean cachePrivate, boolean immutable,
                       boolean mustRevalidate, boolean proxyRevalidate, long sMaxAgeSeconds); static ServerCacheControl parse(String... directives); static ServerCacheControl parse(Iterable<String> directives); static ServerCacheControlBuilder builder(); @Override boolean isEmpty(); boolean cachePublic(); boolean cachePrivate(); boolean immutable(); boolean mustRevalidate(); boolean proxyRevalidate(); long sMaxAgeSeconds(); @Override ServerCacheControlBuilder toBuilder(); @Override String asHeaderValue(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); static final ServerCacheControl EMPTY; static final ServerCacheControl DISABLED; static final ServerCacheControl REVALIDATED; static final ServerCacheControl IMMUTABLE; }
@Test public void testImmutable() { final ServerCacheControl cc = ServerCacheControl.builder().immutable().build(); assertThat(cc.cachePublic()).isFalse(); assertThat(cc.cachePrivate()).isFalse(); assertThat(cc.immutable()).isTrue(); assertThat(cc.mustRevalidate()).isFalse(); assertThat(cc.proxyRevalidate()).isFalse(); assertThat(cc.sMaxAgeSeconds()).isEqualTo(-1); assertThat(cc.asHeaderValue()).isEqualTo("immutable"); assertThat(cc.toString()).isEqualTo("ServerCacheControl(immutable)"); }