Record Class WorldSpigot
java.lang.Object
java.lang.Record
nl.pim16aap2.animatedarchitecture.spigot.util.implementations.WorldSpigot
- All Implemented Interfaces:
IWorld
public record WorldSpigot(String worldName, @Nullable org.bukkit.World world)
extends Record
implements IWorld
Represents an implementation of
IWorld for the Spigot platform.-
Constructor Summary
ConstructorsConstructorDescriptionWorldSpigot(String worldName) WorldSpigot(String worldName, @Nullable org.bukkit.World world) Creates an instance of aWorldSpigotrecord class.WorldSpigot(org.bukkit.World world) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanexists()Checks if this is a valid world in the currentIAnimatedArchitecturePlatform.@Nullable org.bukkit.WorldGets the bukkit world represented by thisIWorldgetTime()Gets the time in this world.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.@Nullable org.bukkit.Worldworld()Returns the value of theworldrecord component.Returns the value of theworldNamerecord component.
-
Constructor Details
-
WorldSpigot
-
WorldSpigot
public WorldSpigot(org.bukkit.World world) -
WorldSpigot
Creates an instance of aWorldSpigotrecord class.- Parameters:
worldName- the value for theworldNamerecord componentworld- the value for theworldrecord component
-
-
Method Details
-
exists
public boolean exists()Description copied from interface:IWorldChecks if this is a valid world in the currentIAnimatedArchitecturePlatform.- Specified by:
existsin interfaceIWorld- Returns:
- True if this is a valid world in the current
IAnimatedArchitecturePlatform.
-
getBukkitWorld
@Nullable public @Nullable org.bukkit.World getBukkitWorld()Gets the bukkit world represented by thisIWorld- Returns:
- The Bukkit world.
-
getTime
Description copied from interface:IWorldGets the time in this world. -
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). -
worldName
Returns the value of theworldNamerecord component. -
world
@Nullable public @Nullable org.bukkit.World world()Returns the value of theworldrecord component.- Returns:
- the value of the
worldrecord component
-