Package be.seeseemelk.mockbukkit.food
Record Class FoodConsumption.FoodEffect
java.lang.Object
java.lang.Record
be.seeseemelk.mockbukkit.food.FoodConsumption.FoodEffect
- Enclosing class:
FoodConsumption
@Internal
public static record FoodConsumption.FoodEffect(org.bukkit.potion.PotionEffect potionEffect, float probability)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionFoodEffect(org.bukkit.potion.PotionEffect potionEffect, float probability) Creates an instance of aFoodEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.org.bukkit.potion.PotionEffectReturns the value of thepotionEffectrecord component.floatReturns the value of theprobabilityrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FoodEffect
public FoodEffect(org.bukkit.potion.PotionEffect potionEffect, float probability) Creates an instance of aFoodEffectrecord class.- Parameters:
potionEffect- the value for thepotionEffectrecord componentprobability- the value for theprobabilityrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
potionEffect
public org.bukkit.potion.PotionEffect potionEffect()Returns the value of thepotionEffectrecord component.- Returns:
- the value of the
potionEffectrecord component
-
probability
public float probability()Returns the value of theprobabilityrecord component.- Returns:
- the value of the
probabilityrecord component
-