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

nl.vpro.domain.media.MidIdentifiable 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
/*
 * Copyright (C) 2010 Licensed under the Apache License, Version 2.0
 * VPRO The Netherlands
 */
package nl.vpro.domain.media;

import com.fasterxml.jackson.annotation.JsonIgnore;

import nl.vpro.domain.Identifiable;

/**
 * Object that are identifiable with their 'MID' (or 'media id'). These ids are generated by METIS.
 * 

* This currently also extends {@link Identifiable} because all objects also have an id that is generated by the poms backend itself. * @since 5.11 */ public interface MidIdentifiable extends Identifiable { String getMid(); /** * The {@link MediaType} of the poms object. E.g. {@link MediaType#BROADCAST} or {@link MediaType#SERIES}. */ MediaType getMediaType(); /** * {@code MedioObject}s can be {@link MediaObjectLocker locked}, normally on their {@link MediaObject#getMid()}, but * in this context we think of it as {@link #getCorrelation()}. In some cases thi is not the same as the {@code mid} itself. * e.g. if there is no {@code mid} filled in yet, or if the object is a {@link Segment} (which is correlated with its parent instead) * @see #getCorrelation() */ @JsonIgnore default String getCorrelationId() { return getCorrelation().id; } /** */ @JsonIgnore default MediaIdentifiable.Correlation getCorrelation() { String mid = getMid(); if (mid != null) { return MediaIdentifiable.Correlation.mid(mid); } return new MediaIdentifiable.Correlation(String.valueOf(hashCode()), MediaIdentifiable.Correlation.Type.HASH); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy