/** * Returns a list of accept strings. */ public List<String> getAcceptList() { List<Accept> accepts = getAccepts(); List<String> result = Lists.newArrayListWithCapacity(accepts.size()); for (Accept accept : accepts) { result.add(accept.getValue()); } return result; }
/** * Returns a list of accept strings. */ public List<String> getAcceptList() { List<Accept> accepts = getAccepts(); List<String> result = Lists.newArrayListWithCapacity(accepts.size()); for (Accept accept : accepts) { result.add(accept.getValue()); } return result; }
/** * Returns a list of accept strings. */ public List<String> getAcceptList() { List<Accept> accepts = getAccepts(); List<String> result = Lists.newArrayListWithCapacity(accepts.size()); for (Accept accept : accepts) { result.add(accept.getValue()); } return result; }
/** * Removes an accept string. * * @param acceptStr the string to remove * @return true if the acceptStr was removed. */ public boolean removeAccept(String acceptStr) { boolean modified = false; for (Accept accept : getAccepts()) { if (acceptStr.equals(accept.getValue())) { super.removeElement(Accept.KEY, accept); modified = true; } } return modified; }
/** * Removes an accept string. * * @param acceptStr the string to remove * @return true if the acceptStr was removed. */ public boolean removeAccept(String acceptStr) { boolean modified = false; for (Accept accept : getAccepts()) { if (acceptStr.equals(accept.getValue())) { super.removeElement(Accept.KEY, accept); modified = true; } } return modified; }
/** * Removes an accept string. * * @param acceptStr the string to remove * @return true if the acceptStr was removed. */ public boolean removeAccept(String acceptStr) { boolean modified = false; for (Accept accept : getAccepts()) { if (acceptStr.equals(accept.getValue())) { super.removeElement(Accept.KEY, accept); modified = true; } } return modified; }
/** * Returns the accept elements. * * @return accept elements */ public List<Accept> getAccepts() { List<Accept> accepts = super.getElements(Accept.KEY); if (coreVersion.isCompatible(Versions.V1)) { // Check for any accepts with a comma, in which case we split those into // multiple accept elements before returning. List<Accept> result = Lists.newArrayList(); for (Accept accept : accepts) { String acceptValue = accept.getValue(); if (acceptValue != null && acceptValue.indexOf(',') != -1) { String[] split = acceptValue.split(","); for (String part : split) { result.add(new Accept(part)); } } else { result.add(accept); } } accepts = result; } return accepts; }
/** * Returns the accept elements. * * @return accept elements */ public List<Accept> getAccepts() { List<Accept> accepts = super.getElements(Accept.KEY); if (coreVersion.isCompatible(Versions.V1)) { // Check for any accepts with a comma, in which case we split those into // multiple accept elements before returning. List<Accept> result = Lists.newArrayList(); for (Accept accept : accepts) { String acceptValue = accept.getValue(); if (acceptValue != null && acceptValue.indexOf(',') != -1) { String[] split = acceptValue.split(","); for (String part : split) { result.add(new Accept(part)); } } else { result.add(accept); } } accepts = result; } return accepts; }
/** * Returns the accept elements. * * @return accept elements */ public List<Accept> getAccepts() { List<Accept> accepts = super.getElements(Accept.KEY); if (coreVersion.isCompatible(Versions.V1)) { // Check for any accepts with a comma, in which case we split those into // multiple accept elements before returning. List<Accept> result = Lists.newArrayList(); for (Accept accept : accepts) { String acceptValue = accept.getValue(); if (acceptValue != null && acceptValue.indexOf(',') != -1) { String[] split = acceptValue.split(","); for (String part : split) { result.add(new Accept(part)); } } else { result.add(accept); } } accepts = result; } return accepts; }
sb.append(','); sb.append(accept.getValue());
sb.append(','); sb.append(accept.getValue());
sb.append(','); sb.append(accept.getValue());