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

info.freelibrary.iiif.presentation.v3.properties.PartOf Maven / Gradle / Ivy

There is a newer version: 0.12.4
Show newest version

package info.freelibrary.iiif.presentation.v3.properties;

import java.net.URI;
import java.util.Objects;
import java.util.Optional;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.core.JsonProcessingException;

import info.freelibrary.util.warnings.Eclipse;

import info.freelibrary.iiif.presentation.v3.JsonParsingException;
import info.freelibrary.iiif.presentation.v3.utils.JSON;

/**
 * A containing resource that includes the resource that has the partOf property. For example, the
 * partOf property on a Canvas can be used to reference an external Manifest in order to enable the
 * discovery of further relevant information. Similarly, a Manifest can reference a containing Collection using
 * partOf to aid in navigation.
 */
public class PartOf extends AbstractLinkProperty {

    /**
     * Creates a partOf reference.
     *
     * @param aID A partOf ID
     * @param aType A partOf type
     */
    public PartOf(final URI aID, final String aType) {
        super(aID, aType);
    }

    /**
     * Creates a partOf reference.
     *
     * @param aID A partOf ID in string form
     * @param aType A partOf type
     */
    public PartOf(final String aID, final String aType) {
        this(URI.create(aID), aType);
    }

    /**
     * Creates a new partOf for Jackson's deserialization.
     */
    @SuppressWarnings(Eclipse.UNUSED)
    private PartOf() {
        super();
    }

    /**
     * Sets the ID.
     *
     * @param aID An ID
     * @return The partOf
     */
    @Override
    public PartOf setID(final URI aID) {
        return (PartOf) super.setID(aID);
    }

    /**
     * Sets the ID from the supplied string.
     *
     * @param aID The ID in string form
     * @return The resource whose ID is being set
     */
    @JsonIgnore
    public PartOf setID(final String aID) {
        return (PartOf) super.setID(URI.create(aID));
    }

    /**
     * Sets the partOf type.
     *
     * @param aType A type
     * @return The partOf
     */
    @Override
    public PartOf setType(final String aType) {
        return (PartOf) super.setType(aType);
    }

    /**
     * Gets an optional descriptive label.
     *
     * @return An optional descriptive label
     */
    public Optional




© 2015 - 2024 Weber Informatics LLC | Privacy Policy