static Option mergeOptions(Option parent, Option child) { if (child == null) { return parent; } if (parent != null && parent.isNoCache() && parent != child) { //merge no cache settings if (parent.getNoCacheGroups() == null || parent.getNoCacheGroups().isEmpty()) { if (child.getNoCacheGroups() != null) { child.getNoCacheGroups().clear(); // full no cache } } else if (child.getNoCacheGroups() != null && !child.getNoCacheGroups().isEmpty()) { for (String noCache : parent.getNoCacheGroups()) { child.addNoCacheGroup(noCache); // only groups } } child.setNoCache(true); } return child; }
static Option mergeOptions(Option parent, Option child) { if (child == null) { return parent; } if (parent != null && parent.isNoCache() && parent != child) { //merge no cache settings if (parent.getNoCacheGroups() == null || parent.getNoCacheGroups().isEmpty()) { if (child.getNoCacheGroups() != null) { child.getNoCacheGroups().clear(); // full no cache } } else if (child.getNoCacheGroups() != null && !child.getNoCacheGroups().isEmpty()) { for (String noCache : parent.getNoCacheGroups()) { child.addNoCacheGroup(noCache); // only groups } } child.setNoCache(true); } return child; }
public static boolean isNoCacheGroup(QueryMetadataInterface metadata, Object metadataID, Option option) throws QueryMetadataException, TeiidComponentException { if(option == null || !option.isNoCache()){ return false; } if(option.getNoCacheGroups() == null || option.getNoCacheGroups().isEmpty()){ //only OPTION NOCACHE, no group specified return true; } String fullName = metadata.getFullName(metadataID); for (String groupName : option.getNoCacheGroups()) { if(groupName.equalsIgnoreCase(fullName)){ return true; } } return false; }
public static boolean isNoCacheGroup(QueryMetadataInterface metadata, Object metadataID, Option option) throws QueryMetadataException, TeiidComponentException { if(option == null || !option.isNoCache()){ return false; } if(option.getNoCacheGroups() == null || option.getNoCacheGroups().isEmpty()){ //only OPTION NOCACHE, no group specified return true; } String fullName = metadata.getFullName(metadataID); for (String groupName : option.getNoCacheGroups()) { if(groupName.equalsIgnoreCase(fullName)){ return true; } } return false; }
public static boolean isNoCacheGroup(QueryMetadataInterface metadata, Object metadataID, Option option) throws QueryMetadataException, TeiidComponentException { if(option == null || !option.isNoCache()){ return false; } if(option.getNoCacheGroups() == null || option.getNoCacheGroups().isEmpty()){ //only OPTION NOCACHE, no group specified return true; } String fullName = metadata.getFullName(metadataID); for (String groupName : option.getNoCacheGroups()) { if(groupName.equalsIgnoreCase(fullName)){ return true; } } return false; }
/** * Return deep copy of this option object * @return Deep copy of the object */ public Object clone() { Option newOption = new Option(); newOption.setNoCache(noCache); if(this.makeDependentGroups != null) { newOption.makeDependentGroups = new ArrayList<String>(this.makeDependentGroups); newOption.makeDependentOptions = new ArrayList<MakeDep>(this.makeDependentOptions); } if(this.makeIndependentGroups != null) { newOption.makeIndependentGroups = new ArrayList<String>(this.makeIndependentGroups); newOption.makeIndependentOptions = new ArrayList<MakeDep>(this.makeIndependentOptions); } if(getNotDependentGroups() != null) { newOption.makeNotDependentGroups = new ArrayList<String>(getNotDependentGroups()); } if(getNoCacheGroups() != null) { newOption.noCacheGroups = new ArrayList<String>(getNoCacheGroups()); } return newOption; } }
/** * Return deep copy of this option object * @return Deep copy of the object */ public Object clone() { Option newOption = new Option(); newOption.setNoCache(noCache); if(this.makeDependentGroups != null) { newOption.makeDependentGroups = new ArrayList<String>(this.makeDependentGroups); newOption.makeDependentOptions = new ArrayList<MakeDep>(this.makeDependentOptions); } if(this.makeIndependentGroups != null) { newOption.makeIndependentGroups = new ArrayList<String>(this.makeIndependentGroups); newOption.makeIndependentOptions = new ArrayList<MakeDep>(this.makeIndependentOptions); } if(getNotDependentGroups() != null) { newOption.makeNotDependentGroups = new ArrayList<String>(getNotDependentGroups()); } if(getNoCacheGroups() != null) { newOption.noCacheGroups = new ArrayList<String>(getNoCacheGroups()); } return newOption; } }
/** * Return deep copy of this option object * @return Deep copy of the object */ public Object clone() { Option newOption = new Option(); newOption.setNoCache(noCache); if(this.makeDependentGroups != null) { newOption.makeDependentGroups = new ArrayList<String>(this.makeDependentGroups); newOption.makeDependentOptions = new ArrayList<MakeDep>(this.makeDependentOptions); } if(this.makeIndependentGroups != null) { newOption.makeIndependentGroups = new ArrayList<String>(this.makeIndependentGroups); newOption.makeIndependentOptions = new ArrayList<MakeDep>(this.makeIndependentOptions); } if(getNotDependentGroups() != null) { newOption.makeNotDependentGroups = new ArrayList<String>(getNotDependentGroups()); } if(getNoCacheGroups() != null) { newOption.noCacheGroups = new ArrayList<String>(getNoCacheGroups()); } return newOption; } }
/** * Get hash code for Option. * @return Hash code */ public int hashCode() { int hc = 0; if(this.makeDependentGroups != null) { hc = HashCodeUtil.hashCode(hc, this.makeDependentGroups); } if(getNotDependentGroups() != null) { hc = HashCodeUtil.hashCode(hc, getNotDependentGroups()); } if(getNoCacheGroups() != null) { hc = HashCodeUtil.hashCode(hc, getNoCacheGroups()); } return hc; }
/** * Get hash code for Option. * @return Hash code */ public int hashCode() { int hc = 0; if(this.makeDependentGroups != null) { hc = HashCodeUtil.hashCode(hc, this.makeDependentGroups); } if(getNotDependentGroups() != null) { hc = HashCodeUtil.hashCode(hc, getNotDependentGroups()); } if(getNoCacheGroups() != null) { hc = HashCodeUtil.hashCode(hc, getNoCacheGroups()); } return hc; }
/** * Get hash code for Option. * @return Hash code */ public int hashCode() { int hc = 0; if(this.makeDependentGroups != null) { hc = HashCodeUtil.hashCode(hc, this.makeDependentGroups); } if(getNotDependentGroups() != null) { hc = HashCodeUtil.hashCode(hc, getNotDependentGroups()); } if(getNoCacheGroups() != null) { hc = HashCodeUtil.hashCode(hc, getNoCacheGroups()); } return hc; }
/** * Compare two Option clauses for equality. * @param obj Other object * @return True if equal */ public boolean equals(Object obj) { if(obj == this) { return true; } if(!(obj instanceof Option)) { return false; } Option other = (Option) obj; return noCache == other.noCache && EquivalenceUtil.areEqual(makeDependentGroups, other.makeDependentGroups) && EquivalenceUtil.areEqual(makeIndependentGroups, other.makeIndependentGroups) && EquivalenceUtil.areEqual(makeDependentOptions, other.makeDependentOptions) && EquivalenceUtil.areEqual(makeIndependentOptions, other.makeIndependentOptions) && EquivalenceUtil.areEqual(getNotDependentGroups(), other.getNotDependentGroups()) && EquivalenceUtil.areEqual(getNoCacheGroups(), other.getNoCacheGroups()); }
if (savedOption.getNoCacheGroups() == null || savedOption.getNoCacheGroups().isEmpty()) { if (option.getNoCacheGroups() != null) { option.getNoCacheGroups().clear(); // full no cache } else if (option.getNoCacheGroups() != null && !option.getNoCacheGroups().isEmpty()) { for (String noCache : savedOption.getNoCacheGroups()) {
/** * Compare two Option clauses for equality. * @param obj Other object * @return True if equal */ public boolean equals(Object obj) { if(obj == this) { return true; } if(!(obj instanceof Option)) { return false; } Option other = (Option) obj; return noCache == other.noCache && EquivalenceUtil.areEqual(makeDependentGroups, other.makeDependentGroups) && EquivalenceUtil.areEqual(makeIndependentGroups, other.makeIndependentGroups) && EquivalenceUtil.areEqual(makeDependentOptions, other.makeDependentOptions) && EquivalenceUtil.areEqual(makeIndependentOptions, other.makeIndependentOptions) && EquivalenceUtil.areEqual(getNotDependentGroups(), other.getNotDependentGroups()) && EquivalenceUtil.areEqual(getNoCacheGroups(), other.getNoCacheGroups()); }
/** * Compare two Option clauses for equality. * @param obj Other object * @return True if equal */ public boolean equals(Object obj) { if(obj == this) { return true; } if(!(obj instanceof Option)) { return false; } Option other = (Option) obj; return noCache == other.noCache && EquivalenceUtil.areEqual(makeDependentGroups, other.makeDependentGroups) && EquivalenceUtil.areEqual(makeIndependentGroups, other.makeIndependentGroups) && EquivalenceUtil.areEqual(makeDependentOptions, other.makeDependentOptions) && EquivalenceUtil.areEqual(makeIndependentOptions, other.makeIndependentOptions) && EquivalenceUtil.areEqual(getNotDependentGroups(), other.getNotDependentGroups()) && EquivalenceUtil.areEqual(getNoCacheGroups(), other.getNoCacheGroups()); }
groups = obj.getNoCacheGroups(); if (groups != null && groups.size() > 0) { append(" "); //$NON-NLS-1$
groups = obj.getNoCacheGroups(); if (groups != null && groups.size() > 0) { append(" "); //$NON-NLS-1$
groups = obj.getNoCacheGroups(); if (groups != null && groups.size() > 0) { append(" "); //$NON-NLS-1$