Package net.commoble.exmachina.api

# Record Class StateComponent

java.lang.Object
java.lang.Record
net.commoble.exmachina.api.StateComponent

Record Components:
  `connector` - StateConnector of a particular blockstate
  `staticLoad` - double value of the resistance of the blockstate
  `staticSource` - double value of the voltage of the blockstate
  `dynamicLoad` - DynamicProperty providing resistance for the blockstate
  `dynamicSource` - DynamicSource providing voltage for the blockstate

public record StateComponent(@NotNull Connector.StateConnector connector, double staticLoad, double staticSource, @NotNull DynamicProperty dynamicLoad, @NotNull DynamicProperty dynamicSource) extends Record
A CircuitComponent, but baked for a particular BlockState

## Field Summary

Fields
Modifier and Type
Field
Description
`static final StateComponent`
`EMPTY`
no-op StateComponent representing a componentless blockstate or invalid component

## Constructor Summary

Constructors
Constructor
Description
`StateComponent(@NotNull Connector.StateConnector connector, double staticLoad, double staticSource, @NotNull DynamicProperty dynamicLoad, @NotNull DynamicProperty dynamicSource)`
Creates an instance of a `StateComponent` record class.

## Method Summary

Modifier and Type
Method
Description
`@NotNull Connector.StateConnector`
`connector()`
Returns the value of the `connector` record component.
`@NotNull DynamicProperty`
`dynamicLoad()`
Returns the value of the `dynamicLoad` record component.
`@NotNull DynamicProperty`
`dynamicSource()`
Returns the value of the `dynamicSource` record component.
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`final int`
`hashCode()`
Returns a hash code value for this object.
`boolean`
`isPresent()`
Returns true if this is a real (non-empty) component.
`double`
`staticLoad()`
Returns the value of the `staticLoad` record component.
`double`
`staticSource()`
Returns the value of the `staticSource` record component.
`final String`
`toString()`
Returns a string representation of this record class.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### EMPTY

public static final StateComponent EMPTY
no-op StateComponent representing a componentless blockstate or invalid component

## Constructor Details

### StateComponent

public StateComponent(@NotNull @NotNull Connector.StateConnector connector, double staticLoad, double staticSource, @NotNull @NotNull DynamicProperty dynamicLoad, @NotNull @NotNull DynamicProperty dynamicSource)
Creates an instance of a `StateComponent` record class.

Parameters:
  `connector` - the value for the `connector` record component
  `staticLoad` - the value for the `staticLoad` record component
  `staticSource` - the value for the `staticSource` record component
  `dynamicLoad` - the value for the `dynamicLoad` record component
  `dynamicSource` - the value for the `dynamicSource` record component

## Method Details

### isPresent

public boolean isPresent()
Returns true if this is a real (non-empty) component.

Returns:
  true if this is a real (non-empty) component

### toString

public final String toString()
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.

Specified by:
  `toString` in class `Record`
Returns:
  a string representation of this object

### hashCode

public final int hashCode()
Returns a hash code value for this object. The value is derived from the hash code of each of the record components.

Specified by:
  `hashCode` in class `Record`
Returns:
  a hash code value for this object

### equals

public final boolean equals(Object o)
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with `Objects::equals(Object,Object)`; primitive components are compared with '=='.

Specified by:
  `equals` in class `Record`
Parameters:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### connector

@NotNull public @NotNull Connector.StateConnector connector()
Returns the value of the `connector` record component.

Returns:
  the value of the `connector` record component

### staticLoad

public double staticLoad()
Returns the value of the `staticLoad` record component.

Returns:
  the value of the `staticLoad` record component

### staticSource

public double staticSource()
Returns the value of the `staticSource` record component.

Returns:
  the value of the `staticSource` record component

### dynamicLoad

@NotNull public @NotNull DynamicProperty dynamicLoad()
Returns the value of the `dynamicLoad` record component.

Returns:
  the value of the `dynamicLoad` record component

### dynamicSource

@NotNull public @NotNull DynamicProperty dynamicSource()
Returns the value of the `dynamicSource` record component.

Returns:
  the value of the `dynamicSource` record component