Package net.commoble.databuddy.datagen

# Record Class BlockStateFile.OrCase

java.lang.Object
java.lang.Record
net.commoble.databuddy.datagen.BlockStateFile.OrCase

Record Components:
  `cases` - List of Cases and/or OrCases to predicate blockstates with

Enclosing class:
  BlockStateFile

public static record BlockStateFile.OrCase(List<com.mojang.datafixers.util.Either<BlockStateFile.OrCase,BlockStateFile.Case>> cases) extends Record
Component of Multipart definitions' 'when' blocks. Represents a union of blockstate predicates, where if any of the cases are true for a given state, then the models specified in the corresponding 'apply' block will be used for that blockstate.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final com.mojang.serialization.Codec<BlockStateFile.OrCase>`
`CODEC`
codec

## Constructor Summary

Constructors
Constructor
Description
`OrCase(List<com.mojang.datafixers.util.Either<BlockStateFile.OrCase,BlockStateFile.Case>> cases)`
Creates an instance of a `OrCase` record class.

## Method Summary

Modifier and Type
Method
Description
`BlockStateFile.OrCase`
`addCase(BlockStateFile.Case theCase)`
Adds a case to this OrCase's list of cases (only usable if list is mutable)
`BlockStateFile.OrCase`
`addOrCase(BlockStateFile.OrCase orCase)`
Adds an OrCase to this OrCase's list of cases (only usable if list is mutable)
`static BlockStateFile.OrCase`
`builder()`
Builder-like helper for datageneration
`List<com.mojang.datafixers.util.Either<BlockStateFile.OrCase,BlockStateFile.Case>>`
`cases()`
Returns the value of the `cases` 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.
`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

### CODEC

public static final com.mojang.serialization.Codec<BlockStateFile.OrCase> CODEC
codec

## Constructor Details

### OrCase

public OrCase(List<com.mojang.datafixers.util.Either<BlockStateFile.OrCase,BlockStateFile.Case>> cases)
Creates an instance of a `OrCase` record class.

Parameters:
  `cases` - the value for the `cases` record component

## Method Details

### builder

public static BlockStateFile.OrCase builder()
Builder-like helper for datageneration

Returns:
  OrCase with mutable list of conditions

### addCase

public BlockStateFile.OrCase addCase(BlockStateFile.Case theCase)
Adds a case to this OrCase's list of cases (only usable if list is mutable)

Parameters:
  `theCase` - Case to add
Returns:
  this

### addOrCase

public BlockStateFile.OrCase addOrCase(BlockStateFile.OrCase orCase)
Adds an OrCase to this OrCase's list of cases (only usable if list is mutable)

Parameters:
  `orCase` - OrCase to add
Returns:
  this

### 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.

### cases

public List<com.mojang.datafixers.util.Either<BlockStateFile.OrCase,BlockStateFile.Case>> cases()
Returns the value of the `cases` record component.

Returns:
  the value of the `cases` record component