1 16 package org.apache.cocoon.caching; 17 18 19 20 29 public final class CompositeCacheValidity 30 implements CacheValidity { 31 32 private CacheValidity v1; 33 private CacheValidity v2; 34 35 38 public CompositeCacheValidity(CacheValidity v1, CacheValidity v2) { 39 this.v1 = v1; 40 this.v2 = v2; 41 } 42 43 public boolean isValid(CacheValidity validity) { 44 if (validity instanceof CompositeCacheValidity) { 45 return (v1.isValid(((CompositeCacheValidity)validity).getValidity1()) && 46 v2.isValid(((CompositeCacheValidity)validity).getValidity2())); 47 } 48 return false; 49 } 50 51 public CacheValidity getValidity1() { 52 return this.v1; 53 } 54 55 public CacheValidity getValidity2() { 56 return this.v2; 57 } 58 59 public String toString() { 60 return "Composite Validity[" + v1 + ':' + v2 + ']'; 61 } 62 } 63 | Popular Tags |