Package dev.latvian.mods.klib.util
Record Class IntOrUUID.IntImpl
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.util.IntOrUUID.IntImpl
- All Implemented Interfaces:
IntOrUUID
- Enclosing interface:
IntOrUUID
public static record IntOrUUID.IntImpl(int value, OptionalInt optionalValue)
extends Record
implements IntOrUUID
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.latvian.mods.klib.util.IntOrUUID
IntOrUUID.IntImpl, IntOrUUID.UUIDImpl -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionIntImpl(int value) IntImpl(int value, OptionalInt optionalValue) Creates an instance of aIntImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptioneither()final booleanIndicates whether some other object is "equal to" this one.@Nullable net.minecraft.world.entity.EntitygetEntity(net.minecraft.world.level.Level level) final inthashCode()Returns a hash code value for this object.Returns the value of theoptionalValuerecord component.booleantestEntity(net.minecraft.world.entity.Entity entity) toString()Returns a string representation of this record class.intvalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
IntImpl
public IntImpl(int value) -
IntImpl
Creates an instance of aIntImplrecord class.- Parameters:
value- the value for thevaluerecord componentoptionalValue- the value for theoptionalValuerecord component
-
-
Method Details
-
either
-
optionalInt
- Specified by:
optionalIntin interfaceIntOrUUID
-
optionalUUID
- Specified by:
optionalUUIDin interfaceIntOrUUID
-
testEntity
public boolean testEntity(net.minecraft.world.entity.Entity entity) - Specified by:
testEntityin interfaceIntOrUUID
-
getEntity
@Nullable public @Nullable net.minecraft.world.entity.Entity getEntity(net.minecraft.world.level.Level level) -
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 '=='. -
value
public int value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
optionalValue
Returns the value of theoptionalValuerecord component.- Returns:
- the value of the
optionalValuerecord component
-