001package org.intellimate.izou.resource;
002
003import org.intellimate.izou.identification.Identifiable;
004import org.intellimate.izou.identification.Identification;
005
006/**
007 * @author Leander Kurscheidt
008 * @version 1.0
009 */
010public interface ResourceModel<T> extends Identifiable {
011    /**
012     * returns the associated Resource data if set.
013     * This method is thread-safe.
014     * @return null or resource data
015     */
016    T getResource();
017
018    /**
019     * returns the ID of the Resource.
020     * This method is thread-safe.
021     * @return a String containing the ID of the resource
022     */
023    String getResourceID();
024
025    /**
026     * returns the provider of the Resource.
027     * This method is thread-safe.
028     * @return an Identification describing the provider of the Resource or null if not set
029     */
030    Identification getProvider();
031
032    /**
033     * returns whether a provider is set
034     * @return true if this resource has an provider, false if not
035     */
036    boolean hasProvider();
037
038    /**
039     * returns the consumer of the object (if set).
040     * @return null or an Identification describing the consumer of the Resource
041     */
042    Identification getConsumer();
043}