Class MultiverseWorld

java.lang.Object
org.mvplugins.multiverse.core.world.MultiverseWorld
Direct Known Subclasses:
LoadedMultiverseWorld

public sealed class MultiverseWorld extends Object permits LoadedMultiverseWorld
Represents a world handled by Multiverse which has all the custom properties provided by Multiverse.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final CoreConfig
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.vavr.control.Option<LoadedMultiverseWorld>
    Attempts to get loaded world instance.
    boolean
    Gets whether or not Multiverse should auto-adjust the spawn for this world.
     
    Gets the alias of this world or defaults to world name if no alias is set.
    @UnmodifiableView Map<String,String>
    Get all meta key-value pairs for this world.
    boolean
    Gets whether or not a player who dies in this world will respawn in their anchor or follow the normal respawn pattern.
    boolean
    Gets whether or not a world will auto-heal players if the difficulty is on peaceful.
    boolean
    Gets whether or not a player who dies in this world will respawn in their bed or follow the normal respawn pattern.
    @NotNull String
    Gets the single biome used for this world.
    Gets the alias without any colour codes
    org.bukkit.Material
    Gets the type of currency that will be used when users enter this world.
    org.bukkit.Difficulty
    Gets the difficulty of this world.
     
    org.bukkit.World.Environment
    Gets the environment of this world.
    org.bukkit.GameMode
    Gets the GameMode of this world.
    Gets the generator string of this world.
    Gets the generator settings used to create this world.
    @NotNull org.bukkit.NamespacedKey
    The key that represents this world.
    @NotNull io.vavr.control.Option<String>
    getMeta(@Nullable String key)
    Gets the meta value for the given key if it exists.
    @NotNull String
    Gets the name of this world.
    Gets the folder where all the world contents are stored in.
    int
    Gets the player limit for this world after which players without an override permission node will not be allowed in.
    Gets which type(s) of portals are allowed to be constructed in this world.
    double
    Gets the amount of currency it requires to enter this world.
    boolean
    Gets whether or not PVP is enabled in this world in some form (fake or not).
    @Nullable org.bukkit.World
    Gets the world players will respawn in if they die in this one.
    Gets the world name players will respawn in if they die in this one.
    double
    Gets the scaling value of this world.Really only has an effect if you use Multiverse-NetherPortals.
    long
    Gets the world seed of this world.
    org.bukkit.Location
    Gets a copy of the spawn location of this world.
    Gets the properties handler of this world.
    Gets the tab complete name of this world.
    Gets a list of all the worlds that players CANNOT travel to from this world,regardless of their access permissions.
    boolean
    Whether player's actions in this world will award them the relevant advancements.
    boolean
    Whether or not players are allowed to fly in this world.
    boolean
    Gets whether weather is enabled in this world.
    boolean
    Gets whether or not Multiverse should auto-load this world on server start.
    boolean
    Gets if entry fee is needed when entering this world
    boolean
    Gets whether or not this world will display in chat, mvw and mvl regardless if a user has the access permissions to go to this world.
    boolean
    Gets whether or not the hunger level of players will go down in a world.
    boolean
    Gets whether or not CraftBukkit is keeping the chunks for this world in memory.
    boolean
    Gets whether this world is loaded.
    @NotNull io.vavr.control.Try<Void>
    removeMeta(@NotNull String key)
    Removes the meta entry associated with the given key.
    io.vavr.control.Try<Void>
    setAdjustSpawn(boolean adjustSpawn)
    Sets whether or not Multiverse should auto-adjust the spawn for this world.
    io.vavr.control.Try<Void>
    Sets the alias of the world.
    io.vavr.control.Try<Void>
    setAllowAdvancementGrant(boolean allowAdvancementGrant)
    Sets whether player's actions in this world will award them the relevant advancements.
    io.vavr.control.Try<Void>
    setAllowFlight(boolean allowFlight)
    Sets whether or not players are allowed to fly in this world.
    io.vavr.control.Try<Void>
    setAllowWeather(boolean allowWeather)
    Sets whether or not there will be weather events in a given world.
    io.vavr.control.Try<Void>
    setAnchorSpawn(boolean anchorSpawn)
    Sets whether or not a player who dies in this world will respawn in their anchor or follow the normal respawn pattern.
    io.vavr.control.Try<Void>
    setAutoHeal(boolean autoHeal)
    Sets whether or not a world will auto-heal players if the difficulty is on peaceful.
    io.vavr.control.Try<Void>
    setAutoLoad(boolean autoLoad)
    Sets whether or not Multiverse should auto-load this world.
    io.vavr.control.Try<Void>
    setBedRespawn(boolean bedRespawn)
    Sets whether or not a player who dies in this world will respawn in their bed or follow the normal respawn pattern.
    io.vavr.control.Try<Void>
    setCurrency(org.bukkit.Material currency)
    Sets the type of item that will be required given the price is not 0.
    io.vavr.control.Try<Void>
    setDifficulty(org.bukkit.Difficulty difficulty)
    Sets the difficulty of this world and returns true on success.
    io.vavr.control.Try<Void>
     
    io.vavr.control.Try<Void>
    setEntryFeeEnabled(boolean entryFeeEnabled)
    Sets if entry fee is needed when entering this world
    io.vavr.control.Try<Void>
    setGameMode(org.bukkit.GameMode gameMode)
    Sets the game mode of this world.
    io.vavr.control.Try<Void>
    setHidden(boolean hidden)
    Sets whether or not this world will display in chat, mvw and mvl regardless if a user has the access permissions to go to this world.
    io.vavr.control.Try<Void>
    setHunger(boolean hunger)
    Sets whether or not the hunger level of players will go down in a world.
    io.vavr.control.Try<Void>
    setKeepSpawnInMemory(boolean keepSpawnInMemory)
    If true, tells Craftbukkit to keep a worlds spawn chunks loaded in memory (default: true) If not, CraftBukkit will attempt to free memory when players have not used that world.
    @NotNull io.vavr.control.Try<Void>
    setMeta(@NotNull String key, @Nullable String value)
    Sets a meta key-value pair for this world.
    io.vavr.control.Try<Void>
    setPlayerLimit(int playerLimit)
    Sets the player limit for this world after which players without an override permission node will not be allowed in.
    io.vavr.control.Try<Void>
    Sets The types of portals that are allowed in this world.
    io.vavr.control.Try<Void>
    setPrice(double price)
    Sets the price for entry to this world.
    io.vavr.control.Try<Void>
    setPvp(boolean pvp)
    Turn pvp on or off.
    io.vavr.control.Try<Void>
    setRespawnWorld(String respawnWorld)
    Sets the world players will respawn in if they die in this one.
    io.vavr.control.Try<Void>
    setRespawnWorld(org.bukkit.World respawnWorld)
    Sets the world players will respawn in if they die in this one.
    io.vavr.control.Try<Void>
    Sets the world players will respawn in if they die in this one.
    io.vavr.control.Try<Void>
    setScale(double scale)
    Sets the scale of this world.
    io.vavr.control.Try<Void>
    setSpawnLocation(org.bukkit.Location spawnLocation)
    Sets the spawn location for a world.
    io.vavr.control.Try<Void>
    setWorldBlacklist(List<String> worldBlacklist)
    Sets the list of worlds that players CANNOT travel to from this world, regardless of their access permissions.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Method Details

    • getKey

      @AvailableSince("5.7") @NotNull public @NotNull org.bukkit.NamespacedKey getKey()
      The key that represents this world. This should now be used as the unique key for the world instead of the world name. Also note that the key cannot be modified.
      Returns:
      The world key
    • getName

      @NotNull public @NotNull String getName()
      Gets the name of this world. Prefer to use getKey() as unique id instead of this name. Also note that the name cannot be modified.
      Note for plugin developers: Usually getAliasOrName()is what you want to use instead of this method.
      Returns:
      The name of the world as a String.
    • getOfflineWorldFolder

      @AvailableSince("5.7") public File getOfflineWorldFolder()
      Gets the folder where all the world contents are stored in. Generally, the location of the folder is at the server roots directory for pre-26.1 servers, and at "[level]/dimensions" folder under the world level directory for 26.1+ PaperMC servers.
      Note this folder location is based on Multiverse's understanding of Paper and Spigot's folder structure. If the server software does something weird, this folder will not reflect the actual world folder location.
      If the world is loaded, you should use World.getWorldFolder() instead as it is more accurate. This method is more of a fallback for when the world is not loaded.
      Returns:
      The world folder.
    • getTabCompleteName

      public String getTabCompleteName()
      Gets the tab complete name of this world. Use alias if `resolve-alias-name` config is true, else use world name.
      Returns:
      The tab complete name of the world as a String
    • isLoaded

      public boolean isLoaded()
      Gets whether this world is loaded. Note that this may return false even if this is a stored instance of LoadedMultiverseWorld as worlds can be unloaded anytime.
      Returns:
      True if the world is loaded, else false.
    • asLoadedWorld

      @AvailableSince("5.5") public io.vavr.control.Option<LoadedMultiverseWorld> asLoadedWorld()
      Attempts to get loaded world instance. Only returns a value if the world is loaded at the time of calling, even if this is a stored instance of LoadedMultiverseWorld.
      You may use isLoaded() to check if the world is loaded first.
      Returns:
      Loaded world instance wrapped in an Option, or None if the world is not loaded.
      Since:
      5.5
    • getStringPropertyHandle

      public StringPropertyHandle getStringPropertyHandle()
      Gets the properties handler of this world.
      Returns:
      The properties handler of this world.
    • getAdjustSpawn

      public boolean getAdjustSpawn()
      Gets whether or not Multiverse should auto-adjust the spawn for this world.
      Returns:
      True if Multiverse should adjust the spawn, false if not.
    • setAdjustSpawn

      public io.vavr.control.Try<Void> setAdjustSpawn(boolean adjustSpawn)
      Sets whether or not Multiverse should auto-adjust the spawn for this world.
      Parameters:
      adjustSpawn - True if multiverse should adjust the spawn, false if not.
      Returns:
      Result of setting property.
    • getAlias

      public String getAlias()
    • setAlias

      public io.vavr.control.Try<Void> setAlias(String alias)
      Sets the alias of the world.
      Parameters:
      alias - A string that is the new alias.
      Returns:
      Result of setting property.
    • getAliasOrName

      public String getAliasOrName()
      Gets the alias of this world or defaults to world name if no alias is set.
      This alias allows users to have a world named "world" but show up in the list as "FernIsland"
      Returns:
      The alias of the world as a String.
    • getColourlessAlias

      public String getColourlessAlias()
      Gets the alias without any colour codes
      Returns:
      The colourless alias
    • isAllowAdvancementGrant

      public boolean isAllowAdvancementGrant()
      Whether player's actions in this world will award them the relevant advancements.
      Returns:
      True if advancements should be granted, false if not
    • setAllowAdvancementGrant

      public io.vavr.control.Try<Void> setAllowAdvancementGrant(boolean allowAdvancementGrant)
      Sets whether player's actions in this world will award them the relevant advancements.
      Parameters:
      allowAdvancementGrant - True if advancements should be granted, false if not
      Returns:
      Result of setting property
    • isAllowFlight

      public boolean isAllowFlight()
      Whether or not players are allowed to fly in this world.
      Returns:
      True if players allowed to fly in this world.
    • setAllowFlight

      public io.vavr.control.Try<Void> setAllowFlight(boolean allowFlight)
      Sets whether or not players are allowed to fly in this world.
      Parameters:
      allowFlight - True to allow flight in this world.
      Returns:
      Result of setting property.
    • isAllowWeather

      public boolean isAllowWeather()
      Gets whether weather is enabled in this world.
      Returns:
      True if weather events will occur, false if not.
    • setAllowWeather

      public io.vavr.control.Try<Void> setAllowWeather(boolean allowWeather)
      Sets whether or not there will be weather events in a given world. If set to false, Multiverse will disable the weather in the world immediately.
      Parameters:
      allowWeather - True if weather events should occur in a world, false if not.
      Returns:
      Result of setting property.
    • getAnchorRespawn

      public boolean getAnchorRespawn()
      Gets whether or not a player who dies in this world will respawn in their anchor or follow the normal respawn pattern.
      Returns:
      True if players dying in this world should respawn at their anchor.
    • setAnchorSpawn

      public io.vavr.control.Try<Void> setAnchorSpawn(boolean anchorSpawn)
      Sets whether or not a player who dies in this world will respawn in their anchor or follow the normal respawn pattern.
      True is default.
      Parameters:
      anchorSpawn - True if players dying in this world respawn at their anchor.
      Returns:
      Result of setting property.
    • getAutoHeal

      public boolean getAutoHeal()
      Gets whether or not a world will auto-heal players if the difficulty is on peaceful.
      Returns:
      True if the world should heal (default), false if not.
    • setAutoHeal

      public io.vavr.control.Try<Void> setAutoHeal(boolean autoHeal)
      Sets whether or not a world will auto-heal players if the difficulty is on peaceful.
      Parameters:
      autoHeal - True if the world will heal.
      Returns:
      Result of setting property.
    • isAutoLoad

      public boolean isAutoLoad()
      Gets whether or not Multiverse should auto-load this world on server start.
      Returns:
      True if Multiverse should auto-load this world on server start.
    • setAutoLoad

      public io.vavr.control.Try<Void> setAutoLoad(boolean autoLoad)
      Sets whether or not Multiverse should auto-load this world.
      True is default.
      Parameters:
      autoLoad - True if multiverse should autoload this world the spawn, false if not.
      Returns:
      Result of setting property.
    • getBedRespawn

      public boolean getBedRespawn()
      Gets whether or not a player who dies in this world will respawn in their bed or follow the normal respawn pattern.
      Returns:
      True if players dying in this world should respawn at their bed.
    • setBedRespawn

      public io.vavr.control.Try<Void> setBedRespawn(boolean bedRespawn)
      Sets whether or not a player who dies in this world will respawn in their bed or follow the normal respawn pattern.
      True is default.
      Parameters:
      bedRespawn - True if players dying in this world respawn at their bed.
      Returns:
      Result of setting property.
    • getBiome

      @NotNull public @NotNull String getBiome()
      Gets the single biome used for this world. This may be null, in which case the biome from the generator will be used. If no generator is specified, the "natural" biome behaviour for this environment will be used.
      Returns:
      The biome used for this world
    • getCurrency

      public org.bukkit.Material getCurrency()
      Gets the type of currency that will be used when users enter this world. A value of null indicates a non-item based currency is used.
      Returns:
      The type of currency that will be used when users enter this world.
    • setCurrency

      public io.vavr.control.Try<Void> setCurrency(org.bukkit.Material currency)
      Sets the type of item that will be required given the price is not 0. Use a value of null to specify a non-item based currency.
      Parameters:
      currency - The Type of currency that will be used when users enter this world.
      Returns:
      Result of setting property.
    • getDifficulty

      public org.bukkit.Difficulty getDifficulty()
      Gets the difficulty of this world.
      Returns:
      The difficulty of this world.
    • setDifficulty

      public io.vavr.control.Try<Void> setDifficulty(org.bukkit.Difficulty difficulty)
      Sets the difficulty of this world and returns true on success. Valid string values are either an integer of difficulty(0-3) or the name that resides in the Bukkit enum, ex. PEACEFUL
      Parameters:
      difficulty - The new difficulty.
      Returns:
      Result of setting property.
    • getEnvironment

      public org.bukkit.World.Environment getEnvironment()
      Gets the environment of this world. You cannot change this after world creation.
      Returns:
      A World.Environment.
    • getGameMode

      public org.bukkit.GameMode getGameMode()
      Gets the GameMode of this world.
      Returns:
      The GameMode of this world.
    • setGameMode

      public io.vavr.control.Try<Void> setGameMode(org.bukkit.GameMode gameMode)
      Sets the game mode of this world.
      Parameters:
      gameMode - The new GameMode.
      Returns:
      Result of setting property.
    • getGenerator

      public String getGenerator()
      Gets the generator string of this world. You cannot change this after world creation.
      Returns:
      The name of the generator.
    • getGeneratorSettings

      @AvailableSince("5.7") public String getGeneratorSettings()
      Gets the generator settings used to create this world. You cannot change this after world creation. Changing this manually in config on existing world will have no effect on the world generation.
      Returns:
      The generator settings string.
      Since:
      5.7
    • isHidden

      public boolean isHidden()
      Gets whether or not this world will display in chat, mvw and mvl regardless if a user has the access permissions to go to this world.
      Returns:
      True if the world will be hidden, false if not.
    • setHidden

      public io.vavr.control.Try<Void> setHidden(boolean hidden)
      Sets whether or not this world will display in chat, mvw and mvl regardless if a user has the access permissions to go to this world.
      Parameters:
      hidden - True if the world should be hidden, false if not.
      Returns:
      Result of setting property.
    • isHunger

      public boolean isHunger()
      Gets whether or not the hunger level of players will go down in a world.
      Returns:
      True if it will go down, false if it will remain steady.
    • setHunger

      public io.vavr.control.Try<Void> setHunger(boolean hunger)
      Sets whether or not the hunger level of players will go down in a world.
      Parameters:
      hunger - True if hunger will go down, false to keep it at the level they entered a world with.
      Returns:
      Result of setting property.
    • isKeepSpawnInMemory

      public boolean isKeepSpawnInMemory()
      Gets whether or not CraftBukkit is keeping the chunks for this world in memory.
      Returns:
      True if CraftBukkit is keeping spawn chunks in memory.
    • setKeepSpawnInMemory

      public io.vavr.control.Try<Void> setKeepSpawnInMemory(boolean keepSpawnInMemory)
      If true, tells Craftbukkit to keep a worlds spawn chunks loaded in memory (default: true) If not, CraftBukkit will attempt to free memory when players have not used that world. This will not happen immediately.
      Parameters:
      keepSpawnInMemory - If true, CraftBukkit will keep the spawn chunks loaded in memory.
      Returns:
      Result of setting property.
    • getAllMeta

      @AvailableSince("5.7") public @UnmodifiableView Map<String,String> getAllMeta()
      Get all meta key-value pairs for this world. This is an unmodifiable view of the internal map, so changes to the world meta will be reflected in this map, but attempts to modify this map will throw an exception.
      Returns:
      An unmodifiable view of all meta key-value pairs for this world.
      Since:
      5.7
    • getMeta

      @AvailableSince("5.7") @NotNull public @NotNull io.vavr.control.Option<String> getMeta(@Nullable @Nullable String key)
      Gets the meta value for the given key if it exists.
      Parameters:
      key - The meta key to look up, may be null in which case an empty result is returned.
      Returns:
      An Option containing the meta value if present, otherwise an empty Option.
      Since:
      5.7
    • setMeta

      @AvailableSince("5.7") @NotNull public @NotNull io.vavr.control.Try<Void> setMeta(@NotNull @NotNull String key, @Nullable @Nullable String value)
      Sets a meta key-value pair for this world. Existing value for the key will be replaced.
      Parameters:
      key - The meta key to set, must not be null.
      value - The meta value to set.
      Returns:
      Result of setting the property.
      Since:
      5.7
    • removeMeta

      @AvailableSince("5.7") @NotNull public @NotNull io.vavr.control.Try<Void> removeMeta(@NotNull @NotNull String key)
      Removes the meta entry associated with the given key.
      Parameters:
      key - The meta key to remove.
      Returns:
      Result of removing the property.
      Since:
      5.7
    • getPlayerLimit

      public int getPlayerLimit()
      Gets the player limit for this world after which players without an override permission node will not be allowed in. A value of -1 or less signifies no limit
      Returns:
      The player limit
    • setPlayerLimit

      public io.vavr.control.Try<Void> setPlayerLimit(int playerLimit)
      Sets the player limit for this world after which players without an override permission node will not be allowed in. A value of -1 or less signifies no limit
      Parameters:
      playerLimit - The new limit
      Returns:
      Result of setting property.
    • getPortalForm

      public AllowedPortalType getPortalForm()
      Gets which type(s) of portals are allowed to be constructed in this world.
      Returns:
      The type of portals that are allowed.
    • setPortalForm

      public io.vavr.control.Try<Void> setPortalForm(AllowedPortalType portalForm)
      Sets The types of portals that are allowed in this world.
      Parameters:
      portalForm - The type of portals allowed in this world.
      Returns:
      Result of setting property.
    • isEntryFeeEnabled

      public boolean isEntryFeeEnabled()
      Gets if entry fee is needed when entering this world
      Returns:
      True if entry fee is needed
    • setEntryFeeEnabled

      public io.vavr.control.Try<Void> setEntryFeeEnabled(boolean entryFeeEnabled)
      Sets if entry fee is needed when entering this world
      Parameters:
      entryFeeEnabled - True to enable use of entry fee
      Returns:
      Result of setting property.
    • getPrice

      public double getPrice()
      Gets the amount of currency it requires to enter this world.
      Returns:
      The amount it costs to enter this world.
    • setPrice

      public io.vavr.control.Try<Void> setPrice(double price)
      Sets the price for entry to this world. You can think of this like an amount. The type can be set with setCurrency(Material)
      Parameters:
      price - The Amount of money/item to enter the world.
      Returns:
      Result of setting property.
    • getPvp

      public boolean getPvp()
      Gets whether or not PVP is enabled in this world in some form (fake or not).
      Returns:
      True if players can take damage from other players.
    • setPvp

      public io.vavr.control.Try<Void> setPvp(boolean pvp)
      Turn pvp on or off. This setting is used to set the world's PVP mode.
      Parameters:
      pvp - True to enable PVP damage, false to disable it.
      Returns:
      Result of setting property.
    • getRespawnWorldName

      public String getRespawnWorldName()
      Gets the world name players will respawn in if they die in this one.
      Returns:
      A world name that exists on the server.
    • getRespawnWorld

      @Nullable public @Nullable org.bukkit.World getRespawnWorld()
      Gets the world players will respawn in if they die in this one.
      Returns:
      A world that exists on the server.
    • setRespawnWorld

      public io.vavr.control.Try<Void> setRespawnWorld(org.bukkit.World respawnWorld)
      Sets the world players will respawn in if they die in this one. Returns true upon success, false upon failure.
      Parameters:
      respawnWorld - The name of a world that exists on the server.
      Returns:
      Result of setting property.
    • setRespawnWorld

      public io.vavr.control.Try<Void> setRespawnWorld(MultiverseWorld respawnWorld)
      Sets the world players will respawn in if they die in this one. Returns true upon success, false upon failure.
      Parameters:
      respawnWorld - The name of a world that exists on the server.
      Returns:
      Result of setting property.
    • setRespawnWorld

      public io.vavr.control.Try<Void> setRespawnWorld(String respawnWorld)
      Sets the world players will respawn in if they die in this one. Returns true upon success, false upon failure.
      Parameters:
      respawnWorld - The name of a world that exists on the server.
      Returns:
      Result of setting property.
    • getScale

      public double getScale()
      Gets the scaling value of this world.Really only has an effect if you use Multiverse-NetherPortals.
      Returns:
      This world's non-negative, non-zero scale.
    • setScale

      public io.vavr.control.Try<Void> setScale(double scale)
      Sets the scale of this world. Really only has an effect if you use Multiverse-NetherPortals.
      Parameters:
      scale - A scaling value, cannot be negative or 0.
      Returns:
      Result of setting property.
    • getSeed

      public long getSeed()
      Gets the world seed of this world. This cannot be changed after world creation.
      Returns:
      The Long version of the seed.
    • getSpawnLocation

      public org.bukkit.Location getSpawnLocation()
      Gets a copy of the spawn location of this world. Location.getWorld() will be null when the world is unloaded. I.e. isLoaded() is false.
      Returns:
      The spawn location of this world.
    • setSpawnLocation

      public io.vavr.control.Try<Void> setSpawnLocation(org.bukkit.Location spawnLocation)
      Sets the spawn location for a world.
      Parameters:
      spawnLocation - The spawn location for a world.
      Returns:
      Result of setting property.
    • getEntitySpawnConfig

      public EntitySpawnConfig getEntitySpawnConfig()
    • setEntitySpawnConfig

      public io.vavr.control.Try<Void> setEntitySpawnConfig(EntitySpawnConfig entitySpawnConfig)
    • getWorldBlacklist

      public List<String> getWorldBlacklist()
      Gets a list of all the worlds that players CANNOT travel to from this world,regardless of their access permissions.
      Returns:
      A List of world names.
    • setWorldBlacklist

      public io.vavr.control.Try<Void> setWorldBlacklist(List<String> worldBlacklist)
      Sets the list of worlds that players CANNOT travel to from this world, regardless of their access permissions.
      Parameters:
      worldBlacklist - A List of world names.
      Returns:
      Result of setting property.
    • toString

      public String toString()
      Overrides:
      toString in class Object