Package net.commoble.exmachina.api

# Record Class BlockComponent

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

Record Components:
  `connector` - BlockConnector for the block
  `staticLoad` - BakedStaticProperty for the block resistance
  `staticSource` - BakedStaticProperty for the block voltage
  `dynamicLoad` - DynamicProperty for the block resistance
  `dynamicSource` - DynamicProperty for the block voltage

public record BlockComponent(@NotNull Connector.BlockConnector connector, @NotNull StaticProperty.BakedStaticProperty staticLoad, @NotNull StaticProperty.BakedStaticProperty staticSource, @NotNull DynamicProperty dynamicLoad, @NotNull DynamicProperty dynamicSource) extends Record
All of the components provided by a `CircuitComponent`, cached and validated for a Block.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final BlockComponent`
`EMPTY`
BlockComponent for blocks which do not have assigned CircuitComponents or are otherwise invalid

## Constructor Summary

Constructors
Constructor
Description
`BlockComponent(@NotNull Connector.BlockConnector connector, @NotNull StaticProperty.BakedStaticProperty staticLoad, @NotNull StaticProperty.BakedStaticProperty staticSource, @NotNull DynamicProperty dynamicLoad, @NotNull DynamicProperty dynamicSource)`
Creates an instance of a `BlockComponent` record class.

## Method Summary

Modifier and Type
Method
Description
`@NotNull Connector.BlockConnector`
`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 component (not empty/invalid).
`@NotNull StaticProperty.BakedStaticProperty`
`staticLoad()`
Returns the value of the `staticLoad` record component.
`@NotNull StaticProperty.BakedStaticProperty`
`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 BlockComponent EMPTY
BlockComponent for blocks which do not have assigned CircuitComponents or are otherwise invalid

## Constructor Details

### BlockComponent

public BlockComponent(@NotNull @NotNull Connector.BlockConnector connector, @NotNull @NotNull StaticProperty.BakedStaticProperty staticLoad, @NotNull @NotNull StaticProperty.BakedStaticProperty staticSource, @NotNull @NotNull DynamicProperty dynamicLoad, @NotNull @NotNull DynamicProperty dynamicSource)
Creates an instance of a `BlockComponent` 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 component (not empty/invalid).

Returns:
  true if this is a real component (not empty/invalid)

### 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. All components in this record class are compared with `Objects::equals(Object,Object)`.

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.BlockConnector connector()
Returns the value of the `connector` record component.

Returns:
  the value of the `connector` record component

### staticLoad

@NotNull public @NotNull StaticProperty.BakedStaticProperty staticLoad()
Returns the value of the `staticLoad` record component.

Returns:
  the value of the `staticLoad` record component

### staticSource

@NotNull public @NotNull StaticProperty.BakedStaticProperty 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