1 4 package com.tc.config.schema.test; 5 6 10 public class CachingPolicyConfigBuilder extends BaseConfigBuilder { 11 12 private final String matchType; 13 private final String name; 14 private final String query; 15 16 public static final String MATCH_TYPE_EXACT = "exact"; 17 public static final String MATCH_TYPE_REGEX = "regex"; 18 19 public static final String POLICY_LATEST_VALID = "latest-valid"; 20 public static final String POLICY_STALE_DATA_ON_EXCEPTION = "stale-data-on-exception"; 21 public static final String POLICY_CACHING_DISABLED = "caching-disabled"; 22 public static final String POLICY_EMPTY_RESULTS_ON_EXCEPTION = "empty-results-on-exception"; 23 24 public CachingPolicyConfigBuilder(String matchType, String name, String query) { 25 super(5, new String [0]); 26 27 this.matchType = matchType; 28 this.name = name; 29 this.query = query; 30 } 31 32 public String toString() { 33 String out = indent() + "<caching-policy"; 34 if (this.matchType != null) out += " match-type=\"" + this.matchType + "\""; 35 if (this.name != null) out += " name=\"" + this.name + "\""; 36 out += ">"; 37 if (this.query != null) out += this.query; 38 out += "</caching-policy>\n"; 39 40 return out; 41 } 42 43 } 44 | Popular Tags |