@Override public List<ICompetition> getCompetitions() { List<ICompetition> cl = new LinkedList<>(); for (Competition c : competitions) { cl.add(c); } return cl; }
/** * Finds the first extension of a specified type. * * @param clazz The type. * @return The extension, or null if none found. */ @SuppressWarnings({"unchecked"}) public <E> E findExtensionOfType(Class<E> clazz) { List<E> candidates = findExtensionsOfType(clazz); if (candidates.size() > 0) { return candidates.get(0); } return null; }
@Override public void setCompetitions(List<ICompetition> competitions) { List<Competition> result = new LinkedList<>(); for (ICompetition d : competitions) { result.add((Competition) d); } this.competitions = result; }
@Override public void setTeamList(List<ITeam> teamList) { List<Team> result = new LinkedList<>(); for (ITeam d : teamList) { result.add((Team) d); } this.teamList = result; }
@XmlTransient @Override public List<ITeam> getTeamList() { List<ITeam> result = new LinkedList<>(); for (Team d : teamList) { result.add(d); } return result; }
/** * Find the extensions of a specified type. * * @param clazz The type. * @return The extensions, possibly empty but not null. */ @SuppressWarnings({"unchecked"}) public <E> List<E> findExtensionsOfType(Class<E> clazz) { List<E> ext = new ArrayList<E>(); if (this.extensionElements != null) { for (Object extension : extensionElements) { if (clazz.isInstance(extension)) { ext.add((E) extension); } } } return ext; }
@Override public int getListSize() { if (vXAuditMaps != null) { return vXAuditMaps.size(); } return 0; }
/** * Find the extension elements of a specified type in the given name and namespace. * * @param clazz The type of the extension element. * @param name The name of the extension element. * @param namespace The namespace of the extension element. * @return The extensions, possibly empty but not null. */ @SuppressWarnings({"unchecked"}) public <E> List<E> findExtensionsOfType(Class<E> clazz, String name, String namespace) { List<E> ext = new ArrayList<E>(); if (this.extensionElements != null) { for (Object extension : extensionElements) { if (JAXBElement.class.isInstance(extension)) { JAXBElement<E> element = (JAXBElement<E>) extension; if (clazz.isInstance(element.getValue()) && element.getName().getLocalPart().equals(name) && element.getName().getNamespaceURI().equals(namespace)) { ext.add(element.getValue()); } } } } return ext; }
@JsonIgnore public ManyMap<String, Attachment> getAttachmentMap() { ManyMap<String, Attachment> map = new ManyMap<String, Attachment>(); if (attachments != null && !attachments.isEmpty()) { for (Attachment attachment : attachments) { map.putOne(attachment.getName(), attachment); } } return map; }
public void removeAsset(Integer id) { List ids = new ArrayList(Arrays.asList(assetIds)); ids.remove(id); assetIds = (Integer[]) ids.toArray(new Integer[ids.size()]); }