Package net.commoble.databuddy.datagen

# Record Class BlockStateFile.Case

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

Record Components:
  `conditions` - Map of property-value conditions.

Enclosing class:
  BlockStateFile

public static record BlockStateFile.Case(Map<String,String> conditions) extends Record
Component of Multipart definitions representing a blockstate predicate. Each entry in this map is of the form "property": "values", using '|' to unionize multiple possible values, e.g. "side": "north|south|east". Each entry in the map must be true for a given blockstate for this case to allow a model to be applied to that state.

## Field Summary

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

## Constructor Summary

Constructors
Constructor
Description
`Case(Map<String,String> conditions)`
Creates an instance of a `Case` record class.

## Method Summary

Modifier and Type
Method
Description
`final <T extends Comparable<T>>
BlockStateFile.Case`
`addCondition(net.minecraft.world.level.block.state.properties.Property<T> property, T value, T... additionalValues)`
Mutably adds a blockstate property condition for one or more property values to this case
`static BlockStateFile.Case`
`builder()`
Builder-like factory for convenience
`Map<String,String>`
`conditions()`
Returns the value of the `conditions` record component.
`static <T extends Comparable<T>>
BlockStateFile.Case`
`create(net.minecraft.world.level.block.state.properties.Property<T> property, T value, T... additionalValues)`
Convenience method returning a single-property case
`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.Case> CODEC
codec

## Constructor Details

### Case

public Case(Map<String,String> conditions)
Creates an instance of a `Case` record class.

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

## Method Details

### create

@SafeVarargs public static <T extends Comparable<T>> BlockStateFile.Case create(net.minecraft.world.level.block.state.properties.Property<T> property, T value, T... additionalValues)
Convenience method returning a single-property case

Type Parameters:
  `T` - The property's value type, e.g. facing properties use `Direction`
Parameters:
  `property` - Blockstate property, e.g. `BlockStateProperties.FACING`
  `value` - A property value, e.g. `Direction.EAST`
  `additionalValues` - optional additional values to add. Multipart allows multiple values per property in a given case, e.g. "east": "side|up" from redstone
Returns:
  this

### builder

public static BlockStateFile.Case builder()
Builder-like factory for convenience

Returns:
  A CaseDefinition with mutable conditions

### addCondition

@SafeVarargs public final <T extends Comparable<T>> BlockStateFile.Case addCondition(net.minecraft.world.level.block.state.properties.Property<T> property, T value, T... additionalValues)
Mutably adds a blockstate property condition for one or more property values to this case

Type Parameters:
  `T` - The property's value type, e.g. facing properties use `Direction`
Parameters:
  `property` - Blockstate property, e.g. `BlockStateProperties.FACING`
  `value` - A property value, e.g. `Direction.EAST`
  `additionalValues` - optional additional values to add. Multipart allows multiple values per property in a given case, e.g. "east": "side|up" from redstone
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.

### conditions

public Map<String,String> conditions()
Returns the value of the `conditions` record component.

Returns:
  the value of the `conditions` record component