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

info.freelibrary.iiif.presentation.v3.DatasetContent Maven / Gradle / Ivy

There is a newer version: 0.12.4
Show newest version

package info.freelibrary.iiif.presentation.v3;

import java.net.URI;
import java.util.Arrays;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonSetter;

import info.freelibrary.iiif.presentation.v3.properties.Behavior;
import info.freelibrary.iiif.presentation.v3.properties.Homepage;
import info.freelibrary.iiif.presentation.v3.properties.Label;
import info.freelibrary.iiif.presentation.v3.properties.Metadata;
import info.freelibrary.iiif.presentation.v3.properties.PartOf;
import info.freelibrary.iiif.presentation.v3.properties.Provider;
import info.freelibrary.iiif.presentation.v3.properties.Rendering;
import info.freelibrary.iiif.presentation.v3.properties.RequiredStatement;
import info.freelibrary.iiif.presentation.v3.properties.SeeAlso;
import info.freelibrary.iiif.presentation.v3.properties.Summary;
import info.freelibrary.iiif.presentation.v3.properties.behaviors.ResourceBehavior;
import info.freelibrary.iiif.presentation.v3.utils.JsonKeys;

/**
 * Dataset content that can be associated with an annotation or set as a thumbnail.
 */
@JsonPropertyOrder({ JsonKeys.ID, JsonKeys.TYPE, JsonKeys.THUMBNAIL, JsonKeys.FORMAT, JsonKeys.LANGUAGE })
public class DatasetContent extends AbstractContentResource
        implements AnnotationBody, ContentResource, Resource {

    /**
     * Creates a dataset content resource from the supplied ID.
     *
     * @param aID An dataset content resource ID in string form
     */
    public DatasetContent(final String aID) {
        super(ResourceTypes.DATASET, aID);
    }

    /**
     * Creates a dataset content resource from the supplied ID.
     *
     * @param aID An dataset content resource ID
     */
    public DatasetContent(final URI aID) {
        super(ResourceTypes.DATASET, aID);
    }

    /**
     * Creates a dataset content resource. This is used by Jackson for its deserialization processes.
     */
    private DatasetContent() {
        super(ResourceTypes.DATASET);
    }

    @Override
    @JsonIgnore
    public DatasetContent setFormat(final MediaType aMediaType) {
        return (DatasetContent) super.setFormat(aMediaType);
    }

    @Override
    @JsonSetter(JsonKeys.FORMAT)
    public DatasetContent setFormat(final String aMediaType) {
        return (DatasetContent) super.setFormat(aMediaType);
    }

    @Override
    @JsonSetter(JsonKeys.PROVIDER)
    public DatasetContent setProviders(final Provider... aProviderArray) {
        return setProviders(Arrays.asList(aProviderArray));
    }

    @Override
    @JsonIgnore
    public DatasetContent setProviders(final List aProviderList) {
        return (DatasetContent) super.setProviders(aProviderList);
    }

    @Override
    public DatasetContent clearBehaviors() {
        return (DatasetContent) super.clearBehaviors();
    }

    @Override
    @JsonSetter(JsonKeys.BEHAVIOR)
    public DatasetContent setBehaviors(final Behavior... aBehaviorArray) {
        return (DatasetContent) super.setBehaviors(checkBehaviors(ResourceBehavior.class, true, aBehaviorArray));
    }

    @Override
    public DatasetContent setBehaviors(final List aBehaviorList) {
        return (DatasetContent) super.setBehaviors(checkBehaviors(ResourceBehavior.class, true, aBehaviorList));
    }

    @Override
    public DatasetContent addBehaviors(final Behavior... aBehaviorArray) {
        return (DatasetContent) super.addBehaviors(checkBehaviors(ResourceBehavior.class, false, aBehaviorArray));
    }

    @Override
    public DatasetContent addBehaviors(final List aBehaviorList) {
        return (DatasetContent) super.addBehaviors(checkBehaviors(ResourceBehavior.class, false, aBehaviorList));
    }

    @Override
    public DatasetContent setSeeAlsoRefs(final SeeAlso... aSeeAlsoArray) {
        return (DatasetContent) super.setSeeAlsoRefs(aSeeAlsoArray);
    }

    @Override
    public DatasetContent setSeeAlsoRefs(final List aSeeAlsoList) {
        return (DatasetContent) super.setSeeAlsoRefs(aSeeAlsoList);
    }

    @Override
    public DatasetContent setServices(final Service... aServiceArray) {
        return (DatasetContent) super.setServices(aServiceArray);
    }

    @Override
    public DatasetContent setServices(final List> aServiceList) {
        return (DatasetContent) super.setServices(aServiceList);
    }

    @Override
    public DatasetContent setPartOfs(final PartOf... aPartOfArray) {
        return (DatasetContent) super.setPartOfs(aPartOfArray);
    }

    @Override
    public DatasetContent setPartOfs(final List aPartOfList) {
        return (DatasetContent) super.setPartOfs(aPartOfList);
    }

    @Override
    public DatasetContent setRenderings(final Rendering... aRenderingArray) {
        return (DatasetContent) super.setRenderings(aRenderingArray);
    }

    @Override
    public DatasetContent setRenderings(final List aRenderingList) {
        return (DatasetContent) super.setRenderings(aRenderingList);
    }

    @Override
    public DatasetContent setHomepages(final Homepage... aHomepageArray) {
        return (DatasetContent) super.setHomepages(aHomepageArray);
    }

    @Override
    public DatasetContent setHomepages(final List aHomepageList) {
        return (DatasetContent) super.setHomepages(aHomepageList);
    }

    @Override
    public DatasetContent setThumbnails(final ContentResource... aThumbnailArray) {
        return (DatasetContent) super.setThumbnails(aThumbnailArray);
    }

    @Override
    public DatasetContent setThumbnails(final List> aThumbnailList) {
        return (DatasetContent) super.setThumbnails(aThumbnailList);
    }

    @Override
    public DatasetContent setID(final String aID) {
        return (DatasetContent) super.setID(aID);
    }

    @Override
    public DatasetContent setID(final URI aID) {
        return (DatasetContent) super.setID(aID);
    }

    @Override
    public DatasetContent setRights(final String aRights) {
        return (DatasetContent) super.setRights(aRights);
    }

    @Override
    public DatasetContent setRights(final URI aRights) {
        return (DatasetContent) super.setRights(aRights);
    }

    @Override
    public DatasetContent setRequiredStatement(final RequiredStatement aStatement) {
        return (DatasetContent) super.setRequiredStatement(aStatement);
    }

    @Override
    public DatasetContent setSummary(final String aSummary) {
        return (DatasetContent) super.setSummary(aSummary);
    }

    @Override
    public DatasetContent setSummary(final Summary aSummary) {
        return (DatasetContent) super.setSummary(aSummary);
    }

    @Override
    public DatasetContent setMetadata(final Metadata... aMetadataArray) {
        return (DatasetContent) super.setMetadata(aMetadataArray);
    }

    @Override
    public DatasetContent setMetadata(final List aMetadataList) {
        return (DatasetContent) super.setMetadata(aMetadataList);
    }

    @Override
    public DatasetContent setLabel(final String aLabel) {
        return (DatasetContent) super.setLabel(aLabel);
    }

    @Override
    public DatasetContent setLabel(final Label aLabel) {
        return (DatasetContent) super.setLabel(aLabel);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy