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

com.pi4j.internal.ProviderProvider Maven / Gradle / Ivy

package com.pi4j.internal;

/*-
 * #%L
 * **********************************************************************
 * ORGANIZATION  :  Pi4J
 * PROJECT       :  Pi4J :: LIBRARY  :: Java Library (CORE)
 * FILENAME      :  ProviderProvider.java
 *
 * This file is part of the Pi4J project. More information about
 * this project can be found here:  https://pi4j.com/
 * **********************************************************************
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import com.pi4j.io.IOType;
import com.pi4j.provider.Provider;
import com.pi4j.provider.exception.ProviderInterfaceException;
import com.pi4j.provider.exception.ProviderNotFoundException;

public interface ProviderProvider extends ProviderAliases {

    /**
     * 

provider.

* * @param providerId a {@link java.lang.String} object. * @param a T object. * @return a T object. * @throws com.pi4j.provider.exception.ProviderNotFoundException if any. */ T provider(String providerId) throws ProviderNotFoundException; /** *

provider.

* * @param providerId a {@link java.lang.String} object. * @param providerClass a T object. * @param the provider type * @return a T object. * @throws ProviderNotFoundException if any. */ T provider(String providerId, Class providerClass) throws ProviderNotFoundException; /** *

provider.

* * @param providerClass a {@link java.lang.Class} object. * @param a T object. * @throws ProviderNotFoundException if any. * @throws ProviderInterfaceException if any. * @return a T object. */ T provider(Class providerClass) throws ProviderNotFoundException, ProviderInterfaceException; /** *

provider.

* * @param ioType a {@link com.pi4j.io.IOType} object. * @param a T object. * @return a T object. * @throws ProviderNotFoundException if the provider specified by {@code ioType} can not be found. */ T provider(IOType ioType) throws ProviderNotFoundException; /** *

hasProvider.

* * @param providerId a {@link java.lang.String} object. * @return a boolean. */ boolean hasProvider(String providerId); /** *

hasProvider.

* * @param providerClass a {@link java.lang.Class} object. * @param a T object. * @return a boolean. */ boolean hasProvider(Class providerClass); /** *

hasProvider.

* * @param ioType a {@link com.pi4j.io.IOType} object. * @param a T object. * @return a boolean. */ boolean hasProvider(IOType ioType); /** *

provider.

* * @param providerId a {@link java.lang.String} object. * @param a T object. * @return a T object. * @throws ProviderNotFoundException if the provider specified by {@code providerId} can not be found. */ default T getProvider(String providerId) throws ProviderNotFoundException{ return provider(providerId); } /** *

provider.

* * @param providerId a {@link java.lang.String} object. * @param a T object. * @return a T object. * @throws ProviderNotFoundException if the provider specified by {@code providerId} can not be found. */ default T getProvider(String providerId, Class providerClass) throws ProviderNotFoundException{ return provider(providerId, providerClass); } /** *

provider.

* * @param providerClass a {@link java.lang.Class} object. * @param a T object. * @return a T object. * @throws ProviderNotFoundException if the provider specified by {@code providerClass} can not be found. * @throws ProviderInterfaceException if {@code providerClass} is not a valid provider. */ default T getProvider(Class providerClass) throws ProviderNotFoundException, ProviderInterfaceException{ return provider(providerClass); } /** *

provider.

* * @param ioType a {@link com.pi4j.io.IOType} object. * @param a T object. * @return a T object. * @throws ProviderNotFoundException if the provider specified by {@code ioType} can not be found. */ default T getProvider(IOType ioType) throws ProviderNotFoundException{ return provider(ioType); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy