Package de.chojo.universalis.worlds
Class Worlds
java.lang.Object
de.chojo.universalis.worlds.Worlds
Class containing the currently valid regions, datacenters and worlds.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe 中国 regionstatic final classThe european regionstatic final classThe japanese regionstatic final classThe north american regionstatic final classThe oceanian region -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Worlds.Chinachina()The 中国 regionstatic @Nullable DataCenterdatacenterById(int id) Retrieves a data center by idstatic @Nullable DataCenterdatacenterByName(@Nullable String name) Retrieves a data center by namestatic Worlds.Europeeurope()The european regionstatic Worlds.Japanjapan()The japanese regionstatic Worlds.NorthAmericaThe north american regionstatic Worlds.Oceaniaoceania()The oceanian regionregionByName(@Nullable String name) Retrieves a region by nameregions()Returns all valid regionsstatic WorldTransforms a world entity to an internal richer world modelstatic WorldworldById(int id) Gets a world by its id.worldByName(@Nullable String name) Retrieve a world by its name
-
Constructor Details
-
Worlds
public Worlds()
-
-
Method Details
-
europe
The european region- Returns:
- europe region
-
northAmerica
The north american region- Returns:
- north american region
-
oceania
The oceanian region- Returns:
- oceanian region
-
japan
The japanese region- Returns:
- japanese region
-
china
The 中国 region- Returns:
- 中国 region
-
regions
Returns all valid regions- Returns:
- unmodifiable list of regions
-
worldById
Gets a world by its id.- Parameters:
id- world id- Returns:
- world if valid or a dummy world with the matching ID
-
datacenterByName
@Nullable @Contract("null -> null") public static @Nullable DataCenter datacenterByName(@Nullable @Nullable String name) Retrieves a data center by name- Parameters:
name- data center name case-insensitive- Returns:
- data center
-
datacenterById
Retrieves a data center by id- Parameters:
id- data center id- Returns:
- data center
-
regionByName
@Nullable @Contract("null -> null") public static @Nullable Region regionByName(@Nullable @Nullable String name) Retrieves a region by name- Parameters:
name- region name case-insensitive- Returns:
- region
-
worldByName
@Nullable @Contract("null -> null") public static @Nullable World worldByName(@Nullable @Nullable String name) Retrieve a world by its name- Parameters:
name- name case-insensitive- Returns:
- world
-
toWorld
Transforms a world entity to an internal richer world model- Parameters:
world- world entity- Returns:
- world
-