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

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

package com.pi4j.internal;

/*-
 * #%L
 * **********************************************************************
 * ORGANIZATION  :  Pi4J
 * PROJECT       :  Pi4J :: LIBRARY  :: Java Library (CORE)
 * FILENAME      :  ProviderAliases.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.io.gpio.analog.AnalogInputProvider;
import com.pi4j.io.gpio.analog.AnalogOutputProvider;
import com.pi4j.io.gpio.digital.DigitalInputProvider;
import com.pi4j.io.gpio.digital.DigitalOutputProvider;
import com.pi4j.io.i2c.I2CProvider;
import com.pi4j.io.pwm.PwmProvider;
import com.pi4j.io.serial.SerialProvider;
import com.pi4j.io.spi.SpiProvider;
import com.pi4j.provider.Provider;
import com.pi4j.provider.exception.ProviderException;
import com.pi4j.provider.exception.ProviderNotFoundException;

public interface ProviderAliases {

    /**
     * 

provider.

* * @param ioType a {@link IOType} object. * @param a T object. * @return a T object. * @throws ProviderNotFoundException if any. */ T provider(IOType ioType) throws ProviderNotFoundException; /** *

provider.

* * @param ioType a {@link IOType} object. * @param a T object. * @return a T object. * @throws ProviderNotFoundException if any. */ default T getProvider(IOType ioType) throws ProviderNotFoundException{ return provider(ioType); } /** *

ain.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T ain() throws ProviderException { return analogInput(); } /** *

aout.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T aout() throws ProviderException{ return analogOutput(); } /** *

din.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T din() throws ProviderException{ return digitalInput(); } /** *

dout.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T dout() throws ProviderException{ return digitalOutput(); } /** *

analogInput.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T analogInput() throws ProviderException { return this.provider(IOType.ANALOG_INPUT); } /** *

analogOutput.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T analogOutput() throws ProviderException{ return this.provider(IOType.ANALOG_OUTPUT); } /** *

digitalInput.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T digitalInput() throws ProviderException{ return this.provider(IOType.DIGITAL_INPUT); } /** *

digitalOutput.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T digitalOutput() throws ProviderException{ return this.provider(IOType.DIGITAL_OUTPUT); } /** *

pwm.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T pwm() throws ProviderException{ return this.provider(IOType.PWM); } /** *

spi.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T spi() throws ProviderException{ return this.provider(IOType.SPI); } /** *

i2c.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T i2c() throws ProviderException{ return this.provider(IOType.I2C); } /** *

serial.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T serial() throws ProviderException{ return this.provider(IOType.SERIAL); } /** *

analogInput.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T getAnalogInputProvider() throws ProviderException { return this.analogInput(); } /** *

analogOutput.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T getAnalogOutputProvider() throws ProviderException{ return this.analogOutput(); } /** *

digitalInput.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T getDigitalInputProvider() throws ProviderException{ return this.digitalInput(); } /** *

digitalOutput.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T getDigitalOutputProvider() throws ProviderException{ return this.digitalOutput(); } /** *

pwm.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T getPwmProvider() throws ProviderException{ return this.pwm(); } /** *

spi.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T getSpiProvider() throws ProviderException{ return this.spi(); } /** *

i2c.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T getI2CProvider() throws ProviderException{ return this.i2c(); } /** *

serial.

* * @param a T object. * @return a T object. * @throws ProviderException if any. */ default T getSerialProvider() throws ProviderException{ return this.serial(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy