Package org.tan.api.getters
Interface TanTerritoryManager
public interface TanTerritoryManager
The TanTerritoryManager interface provides methods for accessing and managing territories within the application.
It allows retrieval of towns and regions by their IDs or names, and provides collections of all towns and regions.
This interface is essential for handling territory-related operations and ensuring proper management of town and region data.
-
Method Summary
Modifier and TypeMethodDescriptionGet a region by its IDgetRegionByName
(String regionName) Get a region by its name
It is recommended to use the UUID instead of the name because names duplicate can happen if the option is enabled in the configurationGet all the regionsGet a town by its IDgetTownByName
(String townName) Get a town by its name
It is recommended to use the UUID instead of the name because names duplicate can happen if the option is enabled in the configurationgetTowns()
Get all the towns
-
Method Details
-
getTown
Get a town by its ID- Parameters:
townID
- the ID of the town- Returns:
- The town if it exists.
Optional.empty()
otherwise
-
getTownByName
Get a town by its name
It is recommended to use the UUID instead of the name because names duplicate can happen if the option is enabled in the configuration- Parameters:
townName
- the name of the town- Returns:
- The town if it exists.
Optional.empty()
otherwise
-
getTowns
Collection<TanTown> getTowns()Get all the towns- Returns:
- a
Collection
of all the towns
-
getRegion
Get a region by its ID- Parameters:
regionID
- the ID of the region- Returns:
- The region if it exists.
Optional.empty()
otherwise
-
getRegionByName
Get a region by its name
It is recommended to use the UUID instead of the name because names duplicate can happen if the option is enabled in the configuration- Parameters:
regionName
- the name of the region- Returns:
- The region if it exists.
Optional.empty()
otherwise
-
getRegions
Collection<TanRegion> getRegions()Get all the regions- Returns:
- a
Collection
of all the regions
-