    001/*-
    002 *******************************************************************************
    003 * Copyright (c) 2011, 2016 Diamond Light Source Ltd.
    004 * All rights reserved. This program and the accompanying materials
    005 * are made available under the terms of the Eclipse Public License v1.0
    006 * which accompanies this distribution, and is available at
    007 * http://www.eclipse.org/legal/epl-v10.html
    008 *
    009 * Contributors:
    010 *    Peter Chang - initial API and implementation and/or initial documentation
    011 *******************************************************************************/
    012
    013package org.eclipse.january.dataset;
    014
    015import java.util.List;
    016
    017import org.eclipse.january.MetadataException;
    018import org.eclipse.january.metadata.IMetadata;
    019import org.eclipse.january.metadata.MetadataType;
    020
    021/**
    022 * Interface which acts to provide metadata from an object
    023 */
    024public interface IMetadataProvider {
    025
    026        /**
    027         * @deprecated Use {@code getFirstMetadata(IMetadata.class)} instead
    028         * @return an instance of IMetadata
    029         * @throws Exception
    030         */
    031        @Deprecated
    032        public IMetadata getMetadata() throws Exception;
    033
    034        /**
    035         * @param clazz if null return everything
    036         * @return list of metadata with given class (or its super interface)
    037         * @throws MetadataException
    038         */
    039        public <S extends MetadataType, T extends S> List<S> getMetadata(Class<T> clazz) throws MetadataException;
    040
    041        /**
    042         * @param clazz if null return first from everything
    043         * @return first element from list of metadata with given class (or its super interface)
    044         */
    045        public <S extends MetadataType, T extends S> S getFirstMetadata(Class<T> clazz);
    046}