nl.vpro.domain.classification.ClassificationScheme Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of media-classification Show documentation
Show all versions of media-classification Show documentation
The classes needed for the 'classification' service used in POMS.
This os based on ClassificationScheme xml's as provided by EBU.
It at the moment is only used for genres, but it could in principle accommodate other types of classification based on
a fixed list.
/*
* Copyright (C) 2014 Licensed under the Apache License, Version 2.0
* VPRO The Netherlands
*/
package nl.vpro.domain.classification;
import lombok.ToString;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.*;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* @author Roelof Jan Koekoek
* @since 3.0
*/
@XmlType(propOrder = {
})
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "ClassificationScheme")
@ToString
public class ClassificationScheme implements TermContainer {
@XmlElement(name = "Term")
private List terms;
@XmlAttribute
@Nullable
private String uri;
public ClassificationScheme(@Nullable String uri, List rootTerms) {
this.terms = rootTerms;
this.uri = uri;
}
private ClassificationScheme() {
}
@Nullable
public String getUri() {
return uri;
}
@Override
public List getTerms() {
if (terms == null) {
terms = new ArrayList<>();
}
return terms;
}
}