/** * Will return a collection of issue type ids that are in use on issues that have values for the specified * custom field id. * * @param customFieldId the custom field id * @return collection of issue type ids that are in use on issues that have values for the specified * custom field id */ public Collection /*<String>*/getIssueTypeIdsForRequiredCustomField(final String customFieldId) { return (Collection) issueTypesInUse.get(customFieldId); }
/** * Return the content that begins with the specified string. * * @param s */ public List getContents(String s) { return (List) alphabetBuckets.get(s); }
@Override public Collection<String> getHeaderValues(String headerName) { return (Collection<String>) headers.get(headerName); }
public Collection /*<String>*/getIssueTypeIdsForRequiredStatus(final String statusId) { return (Collection) requiredOldIds.get(statusId); }
public Collection<String> getHeader(String headerName) { return (Collection<String>) headers.get(headerName); }
public List<V> getAll(K key) { List<V> result = (List<V>) m_impl.get(key); if (result == null) { result = Collections.emptyList(); } return result; }
@Override public String getHeaderValue(String headerName) { final Object value = headers.get(headerName); if (value == null) { return null; } return (String) ((Collection)value).iterator().next(); }
public String getFirstHeader(String headerName) { final Object value = headers.get(headerName); return (String) (value == null ? value : ((Collection)value).iterator().next()); }
public List<String> getTransitionIssueKeys(final WorkflowTransitionKey workflowTransitionKey) { @SuppressWarnings ("unchecked") final List<String> workflowIssues = new ArrayList<String>((List<String>) workflowTransitionMap.get(workflowTransitionKey)); // Sort the list Collections.sort(workflowIssues, KeyComparator.COMPARATOR); return workflowIssues; }
public V getOne(K key) throws IllegalArgumentException { List<V> all = (List<V>) m_impl.get(key); if (all == null) { return null; } if (all.size() > 1) { throw new IllegalArgumentException("More than one element was found for key: " + key); } return all.get(0); }
/** * Returns all values for the given key * @param key key (case insensitive) * @return all values of the given header or {@code null}, if there is no such a key in this instance */ public List<String> getValues(final String key) { Validate.notEmpty(key, "name cannot be empty"); @SuppressWarnings("unchecked") final List<String> result = (List<String>) values.get(key.toLowerCase()); return result == null || result.isEmpty() ? null : new ArrayList<String>(result); }
/** * Returns all values for the given key * @param key key (case insensitive) * @return all values of the given header or {@code null}, if there is no such a key in this instance */ public List<String> getValues(final String key) { Validate.notEmpty(key, "name cannot be empty"); @SuppressWarnings("unchecked") final List<String> result = (List<String>) values.get(key.toLowerCase()); return result == null || result.isEmpty() ? null : new ArrayList<String>(result); }
public long getLastModified() { // we're using a MultiMap. And all this is to workaround code that would possibly set the Last-Modified header with a String value // it will also fail if multiple values have been set. final Collection values = (Collection) headers.get("Last-Modified"); if (values == null || values.size() != 1) { throw new IllegalStateException("Can't get Last-Modified header : no or multiple values : " + values); } final Object value = values.iterator().next(); if (value instanceof String) { return parseStringDate((String) value); } else if (value instanceof Long) { return ((Long) value).longValue(); } else { throw new IllegalStateException("Can't get Last-Modified header : " + value); } }
public Map toMap() { Map paramMap = new HashMap(); for (Object key : map.keySet()) { List list = (List) map.get(key); String[] vals = new String[list.size()]; for (int i = 0; i < vals.length; i++) { vals[i] = String.valueOf(list.get(i)); } paramMap.put(key, vals); } return paramMap; } }
public boolean handleEvent(final ValidationEvent event) { final Collection listeners = (Collection) handlersMap.get(event.getLocator()); if (null != listeners) { for (Iterator iterator = listeners.iterator(); iterator.hasNext();) { final ValidationEventHandler handler = (ValidationEventHandler) iterator.next(); handler.handleEvent(event); } } return true; }
private KeyValues createHeaders() { KeyValues res = new KeyValues(); for (@SuppressWarnings("unchecked") final Iterator<String> itKey = (Iterator<String>) this.headers.keySet().iterator(); itKey.hasNext();) { final String key = itKey.next(); for (@SuppressWarnings("unchecked") final Iterator<String> itValue = ((Collection<String>)this.headers.get(key)).iterator(); itValue.hasNext();) { res = res.add(key, itValue.next()); } } return res; } }
private KeyValues createHeaders() { KeyValues res = new KeyValues(); for (@SuppressWarnings("unchecked") final Iterator<String> itKey = (Iterator<String>) this.headers.keySet().iterator(); itKey.hasNext();) { final String key = itKey.next(); for (@SuppressWarnings("unchecked") final Iterator<String> itValue = ((Collection<String>)this.headers.get(key)).iterator(); itValue.hasNext();) { res = res.add(key, itValue.next()); } } return res; } }
/** * Merge default and discovered overrides for descriptor parsers, taking weight into account * * @param overrides discovered parser overrides */ protected void mergeParserOverrides(MultiMap overrides) { PreferredObjectSelector<DescriptorParser> selector = new PreferredObjectSelector<DescriptorParser>(); for (Map.Entry<String, DescriptorParser> entry : parserRegistry.entrySet()) { @SuppressWarnings("unchecked") final Collection<DescriptorParser> candidates = (Collection<DescriptorParser>) overrides.get(entry.getKey()); if (candidates != null) { parserRegistry.put(entry.getKey(), selector.select(candidates.iterator())); } } } }
public Status getOriginStatus(final WorkflowTransitionKey workflowTransitionKey) { final Collection issueKeys = (Collection) getBulkEditBean().getWorkflowTransitionMap().get(workflowTransitionKey); final String issueKey = (String) issueKeys.iterator().next(); final Issue issue = issueManager.getIssueObject(issueKey); return issue.getStatus(); }
private void initBeanWithSelection() throws Exception { final MultiMap workflowTransitionMap = getBulkEditBean().getWorkflowTransitionMap(); final WorkflowTransitionKey workflowTransitionKey = getBulkEditBean().getSelectedWFTransitionKey(); final Collection issueKeys = (Collection) workflowTransitionMap.get(workflowTransitionKey); final ActionDescriptor actionDescriptor = getBulkWorkflowTransitionOperation().getActionDescriptor(workflowTransitionKey); final Collection<Issue> issues = Lists.newArrayListWithCapacity(issueKeys.size()); for (final Object issueKey1 : issueKeys) { final String issueKey = (String) issueKey1; final Issue issue = issueManager.getIssueObject(issueKey); issues.add(issue); } getBulkEditBean().initSelectedIssues(issues); final FieldScreenRenderer fieldScreenRenderer = fieldScreenRendererFactory.getFieldScreenRenderer(issues, actionDescriptor); getBulkEditBean().setFieldScreenRenderer(fieldScreenRenderer); }