Package net.minestom.server.snapshot
Record Class SnapshotImpl.Server
java.lang.Object
java.lang.Record
net.minestom.server.snapshot.SnapshotImpl.Server
- All Implemented Interfaces:
ServerSnapshot
,Snapshot
- Enclosing class:
SnapshotImpl
public static record SnapshotImpl.Server(Collection<InstanceSnapshot> instances, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<AtomicReference<EntitySnapshot>> entityRefs)
extends Record
implements ServerSnapshot
-
Constructor Summary
ConstructorDescriptionServer
(Collection<InstanceSnapshot> instances, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<AtomicReference<EntitySnapshot>> entityRefs) Creates an instance of aServer
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection
<EntitySnapshot> entities()
@UnknownNullability EntitySnapshot
entity
(int id) it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
<AtomicReference<EntitySnapshot>> Returns the value of theentityRefs
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theinstances
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Server
public Server(Collection<InstanceSnapshot> instances, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<AtomicReference<EntitySnapshot>> entityRefs) Creates an instance of aServer
record class.- Parameters:
instances
- the value for theinstances
record componententityRefs
- the value for theentityRefs
record component
-
-
Method Details
-
entities
- Specified by:
entities
in interfaceServerSnapshot
-
entity
- Specified by:
entity
in interfaceServerSnapshot
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
instances
Returns the value of theinstances
record component.- Specified by:
instances
in interfaceServerSnapshot
- Returns:
- the value of the
instances
record component
-
entityRefs
public it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<AtomicReference<EntitySnapshot>> entityRefs()Returns the value of theentityRefs
record component.- Returns:
- the value of the
entityRefs
record component
-