Package com.opensourcewithslu.utilities
Class DigitalOutputConfiguration
java.lang.Object
com.opensourcewithslu.utilities.DigitalOutputConfiguration
@Prototype
@EachProperty("pi4j.digital-output")
public class DigitalOutputConfiguration
extends Object
This class handles the configuration of a digital output component.
-
Constructor Summary
ConstructorsConstructorDescriptionThe DigitalOutputConfiguration constructor. -
Method Summary
Modifier and TypeMethodDescriptionintGets the pin address for the component.getId()Gets the id of the component.com.pi4j.io.gpio.digital.DigitalStateGets the initial state of the component.getName()Gets the name of the component.Gets the provider for the component.com.pi4j.io.gpio.digital.DigitalStateGets the shutdown state of the component.voidsetAddress(int address) Sets the pin address.voidsetInitial(com.pi4j.io.gpio.digital.DigitalState initial) Sets the initial state for the component.voidSets the name of the component.voidsetProvider(String provider) Sets the provider.voidsetShutdown(com.pi4j.io.gpio.digital.DigitalState shutdown) Sets the shutdown state for the component.
-
Constructor Details
-
DigitalOutputConfiguration
The DigitalOutputConfiguration constructor.- Parameters:
id- The configuration id as defined in the application.yml.
-
-
Method Details
-
getId
Gets the id of the component.- Returns:
- The id of the component.
-
getName
Gets the name of the component.- Returns:
- The String name of the component.
-
setName
Sets the name of the component.- Parameters:
name- The String that the name will be set as.
-
getInitial
public com.pi4j.io.gpio.digital.DigitalState getInitial()Gets the initial state of the component.- Returns:
- The initial state of the component.
-
setInitial
public void setInitial(com.pi4j.io.gpio.digital.DigitalState initial) Sets the initial state for the component.- Parameters:
initial- The Digital state that the component will start was.
-
getShutdown
public com.pi4j.io.gpio.digital.DigitalState getShutdown()Gets the shutdown state of the component.- Returns:
- The digital state of the component.
-
setShutdown
public void setShutdown(com.pi4j.io.gpio.digital.DigitalState shutdown) Sets the shutdown state for the component.- Parameters:
shutdown- DigitalState enum.
-
getAddress
public int getAddress()Gets the pin address for the component.- Returns:
- An array of the pin addresses.
-
setAddress
public void setAddress(int address) Sets the pin address.- Parameters:
address- Integer representing the new pin address.
-
getProvider
Gets the provider for the component.- Returns:
- A String representation of the provider.
-
setProvider
Sets the provider.- Parameters:
provider- The new provider for the component.
-