/** * Returns a map consisting of all suffixes of context items that match the specified prefix. * * @param prefix Item name less any suffix. * @return Map of all suffixes whose prefix matches the specified value. The value of each map * entry is the value of the original context item. */ public Map<String, String> getSuffixes(String prefix) { return getSuffixes(prefix, false); }
/** * Returns a map consisting of all suffixes of context items that match the specified prefix. * * @param prefix Item name less any suffix. * @return Map of all suffixes whose prefix matches the specified value. The value of each map * entry is the value of the original context item. */ public Map<String, String> getSuffixes(String prefix) { return getSuffixes(prefix, false); }
/** * Returns true if any context item belonging to the specified subject exists. * * @param subject The subject of interest. * @return True if the subject was found. */ public boolean containsSubject(String subject) { return !getSuffixes(subject, true).isEmpty(); }
/** * Returns true if any context item belonging to the specified subject exists. * * @param subject The subject of interest. * @return True if the subject was found. */ public boolean containsSubject(String subject) { return !getSuffixes(subject, true).isEmpty(); }
/** * Remove all context items for the specified subject. * * @param subject Prefix whose items are to be removed. */ public void removeSubject(String subject) { String prefix = normalizePrefix(subject); for (String suffix : getSuffixes(prefix).keySet()) { setItem(prefix + suffix, null); } }
/** * Remove all context items for the specified subject. * * @param subject Prefix whose items are to be removed. */ public void removeSubject(String subject) { String prefix = normalizePrefix(subject); for (String suffix : getSuffixes(prefix).keySet()) { setItem(prefix + suffix, null); } }