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

nl.vpro.domain.media.RecursiveParentChildRelation 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;

import java.util.SortedSet;
import java.util.TreeSet;

/**
 *
 *
 * @author Michiel Meeuwissen
 * @since 5.13.1
 */
public interface RecursiveParentChildRelation extends ParentChildRelation {

	SortedSet getMemberOf();

	void setMemberOf(SortedSet  memberOf);

	default SortedSet getOrCreateMemberOf() {
		if (getMemberOf() == null) {
			setMemberOf(new TreeSet<>());
		}
		return getMemberOf();
	}

	SortedSet getEpisodeOf();

	void setEpisodeOf(SortedSet episodeOf);

	default SortedSet getOrCreateEpisodeOf() {
		if (getEpisodeOf() == null) {
			setEpisodeOf(new TreeSet<>());
		}
		return getEpisodeOf();
	}

	default SortedSet getOrCreate(StandaloneMemberRef.ObjectType type) {
	    switch(type) {
            case memberRef: return getOrCreateMemberOf();
            case episodeRef: return getOrCreateEpisodeOf();
        }
        throw new UnsupportedOperationException();
    }


	RecursiveMemberRef getSegmentOf();

	void setSegmentOf(RecursiveMemberRef recursiveMemberRef);


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy