/** * Adds a {@link MediaPackageElement} to this publication by determining its type. * * @param publication * The {@link Publication} to add the {@link MediaPackageElement} to. * @param element * The {@link MediaPackageElement} to add. If it is not a {@link Attachment}, {@link Catalog} or * {@link Track} it will not be added to the {@link Publication}. */ public static void addElementToPublication(Publication publication, MediaPackageElement element) { if (MediaPackageElement.Type.Track.equals(element.getElementType())) { publication.addTrack((Track) element); } else if (MediaPackageElement.Type.Catalog.equals(element.getElementType())) { publication.addCatalog((Catalog) element); } else if (MediaPackageElement.Type.Attachment.equals(element.getElementType())) { publication.addAttachment((Attachment) element); } }