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 IntOrUUID
IntOrUUID.IntImpl, IntOrUUID.UUIDImpl -
Field Summary
Fields inherited from interface IntOrUUID
CODEC, DATA_TYPE, STREAM_CODEC -
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
-
optionalInteger
- Specified by:
optionalIntegerin interfaceIntOrUUID
-
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
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
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
-