Пример #1
0
 @Override
 public List<ICompetition> getCompetitions() {
   List<ICompetition> cl = new LinkedList<>();
   for (Competition c : competitions) {
     cl.add(c);
   }
   return cl;
 }
Пример #2
0
  /**
   * 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;
  }
Пример #3
0
  @Override
  public void setCompetitions(List<ICompetition> competitions) {
    List<Competition> result = new LinkedList<>();

    for (ICompetition d : competitions) {
      result.add((Competition) d);
    }

    this.competitions = result;
  }
Пример #4
0
  @Override
  public void setTeamList(List<ITeam> teamList) {
    List<Team> result = new LinkedList<>();

    for (ITeam d : teamList) {
      result.add((Team) d);
    }

    this.teamList = result;
  }
Пример #5
0
  @XmlTransient
  @Override
  public List<ITeam> getTeamList() {
    List<ITeam> result = new LinkedList<>();

    for (Team d : teamList) {
      result.add(d);
    }

    return result;
  }
Пример #6
0
  /**
   * 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;
 }
Пример #8
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;
  }
Пример #9
0
 @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;
 }
Пример #10
0
 public void removeAsset(Integer id) {
   List ids = new ArrayList(Arrays.asList(assetIds));
   ids.remove(id);
   assetIds = (Integer[]) ids.toArray(new Integer[ids.size()]);
 }