All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.vpro.domain.media.update.MediaIdentifiableImpl Maven / Gradle / Ivy

Go to download

The basic domain classes for 'media', the core of POMS. Also, the 'update' XML bindings for it. It also contains some closely related domain classes like the enum to contain NICAM kijkwijzer settings.

There is a newer version: 8.3.1
Show newest version
package nl.vpro.domain.media.update;

import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;

import jakarta.xml.bind.annotation.*;

import nl.vpro.domain.media.MediaType;
import nl.vpro.domain.media.MediaIdentifiable;
import nl.vpro.validation.StringList;

/**
* @author Michiel Meeuwissen
* @since 3.4
*/
@XmlRootElement(name = "midAndType")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "midAndTypeType")
public class MediaIdentifiableImpl implements Serializable, MediaIdentifiable {

    @Serial
    private static final long serialVersionUID = 0L;

    @XmlAttribute
    @Getter
    private String mid;


    @XmlAttribute
    @Getter
    private Long  id;

    @XmlAttribute(name = "type")
    @Getter
    private MediaType mediaType;

    @XmlElement(name = "crid")
    @StringList(pattern = "(?i)crid://.*/.*")
    @Getter
    @Setter
    private List crids;

    public MediaIdentifiableImpl() {
        // required by JAXB.
    }

    public MediaIdentifiableImpl(String mid, MediaType type, List crids) {
        this.mid = mid;
        this.mediaType = type;
        this.crids = crids == null ? Collections.emptyList() : Collections.unmodifiableList(crids);
    }



    @Override
    public String toString() {
        return mediaType + " " + mid + crids;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy