public static interface

CoreApi.Properties

com.mapsted.positioning.CoreApi.Properties

Class Overview

Use PropertyManager for property related information and functionalities

Summary

Public Methods
abstract boolean addPropertyDownloadListener(PropertyDownloadManager.Listener listener)
add listener which will be notified anytime a property is downloaded
abstract boolean addUnloadPropertyDataListener(CoreApi.UnloadPropertyDataListener listener)
add listener for change in property data
abstract void delete(int propertyId, Consumer<Boolean> onComplete)
Delete property data from persistent storage.
abstract void deserializePropertyDataAsync(int propertyId, PropertyDataDownloadListener propertyDataDownloadListener)
Download a property's property data based on its property id.
abstract void findEntityByName(String name, int propertyId, Consumer<List<SearchEntity>> callback)
Method to retrieve the list of SearchEntity by a propertyID that matches the nameSubString
abstract List<PropertyInfo> getAll()
Get the list of PropertyInfo
abstract Set<Integer> getAllIds()
Get a Set of property ids that indicates all properties stored.
abstract PropertyData getCached(int propertyId)
Get a property's cached PropertyData from core library based on property id.
abstract Entity getCachedEntity(EntityZone entityZone)
Get cached entity based on entity zone.
abstract Set<Integer> getCachedPropertyIds()
Get a java.util.HashSet of property ids that indicates all properties cached.
abstract void getCategories(int propertyId, Consumer<CategoriesResult> resultCallback)
Get categories for the property
abstract void getData(int propertyId, Consumer<PropertyData> callback)
Gets cached PropertyData or triggers download, if necessary
abstract DownloadStatus getDownloadStatus(int propertyId)
Get the current DownloadStatus of a property.
abstract Entity getEntity(int propertyId, int buildingId, int entityId)
abstract void getEntity(EntityZone entityZone, Consumer<Entity> callback)
Get entity based on entity zone.
abstract PropertyInfo getInfo(int propertyId)
Get PropertyInfo corresponding to a specific property id.
abstract Optional<PropertyInfo> getInfoOptional(int propertyId)
abstract void getInfos(Consumer<Map<Integer, PropertyInfo>> consumer)
Async fetch the property Infos
abstract Map<Integer, PropertyInfo> getInfos()
Get PropertyInfoMap stored in core library.
abstract int getNumCachedProperties()
Get the number of properties currently cached in memory
abstract void getSearchEntityListByPropertyId(int propertyId, Consumer<List<SearchEntity>> callback)
Method to retrieve the list of SearchEntity by a propertyID
abstract int getSelectedProperty()
abstract boolean isCached(int propertyId)
Checks whether a given property is cached in memory
abstract boolean removePropertyDownloadListener(PropertyDownloadManager.Listener listener)
remove listener
abstract boolean removeUnloadPropertyDataListener(CoreApi.UnloadPropertyDataListener listener)
remove listener
abstract void searchPoi(int propertyId, PoiFilter poiFilter, Consumer<List<? extends ISearchable>> resultCallback)
searches for points of interest based on given PoiFilter.
abstract void setSelectedPropertyId(int propertyId)
abstract void startDownload(int propertyId, PropertyDownloadManager.Listener listener)
Download a property map data.
abstract void stopDownload(int propertyId)
Stop download property information.
abstract void unload(int propertyId, Consumer<Boolean> onComplete)
Unload property data from memory.

Public Methods

public abstract boolean addPropertyDownloadListener (PropertyDownloadManager.Listener listener)

add listener which will be notified anytime a property is downloaded

Parameters
listener the listener

public abstract boolean addUnloadPropertyDataListener (CoreApi.UnloadPropertyDataListener listener)

add listener for change in property data

Parameters
listener the listener

public abstract void delete (int propertyId, Consumer<Boolean> onComplete)

Delete property data from persistent storage.

This will remove property data from database and from core library.

Note: If you are using map module as well, please call remove property data in MapstedMapApi.

Parameters
propertyId Property id that needs to be deleted.
onComplete Notified when unload is complete, returns success or failure

public abstract void deserializePropertyDataAsync (int propertyId, PropertyDataDownloadListener propertyDataDownloadListener)

Download a property's property data based on its property id.

This function is an asynchronous function with a final callback which is called once the function is completed.

Parameters
propertyId The property id corresponding to a property to be downloaded.
propertyDataDownloadListener A listener that handles downloading property data. See PropertyDataDownloadListener

public abstract void findEntityByName (String name, int propertyId, Consumer<List<SearchEntity>> callback)

Method to retrieve the list of SearchEntity by a propertyID that matches the nameSubString

public abstract List<PropertyInfo> getAll ()

Get the list of PropertyInfo

Returns
  • List List of properties

public abstract Set<Integer> getAllIds ()

Get a Set of property ids that indicates all properties stored.

Returns
  • A set of all stored property id.

public abstract PropertyData getCached (int propertyId)

Get a property's cached PropertyData from core library based on property id.

Parameters
propertyId The stored property's property id.
Returns
  • The stored property data that was requested. See PropertyData

public abstract Entity getCachedEntity (EntityZone entityZone)

Get cached entity based on entity zone. Note that if the Zone (property and/or building) is not cached, it will return null

Parameters
entityZone The entity zone to retrieve
Returns
  • Corresponding cached Entity or null if not cached or does not exist

public abstract Set<Integer> getCachedPropertyIds ()

Get a java.util.HashSet of property ids that indicates all properties cached.

Returns
  • A java.util.HashSet set of all stored property id.

public abstract void getCategories (int propertyId, Consumer<CategoriesResult> resultCallback)

Get categories for the property

Parameters
propertyId propertyId
resultCallback callback for result

public abstract void getData (int propertyId, Consumer<PropertyData> callback)

Gets cached PropertyData or triggers download, if necessary

Parameters
propertyId property id
callback callback with property data

public abstract DownloadStatus getDownloadStatus (int propertyId)

Get the current DownloadStatus of a property.

Parameters
propertyId Property id to check its downloading status.
Returns
  • The download status for property id. See DownloadStatus

public abstract Entity getEntity (int propertyId, int buildingId, int entityId)

public abstract void getEntity (EntityZone entityZone, Consumer<Entity> callback)

Get entity based on entity zone. Will return a cached entity if found, otherwise will download

Parameters
entityZone The entity zone to retrieve
callback with Corresponding cached Entity or prepares by downloading, may still return null.

public abstract PropertyInfo getInfo (int propertyId)

Get PropertyInfo corresponding to a specific property id.

Property consists of all property information such as the property's id, the name of the property, X and Y coordinates etc.

Parameters
propertyId Building id corresponding to the BuildingInfo you get.
Returns

public abstract Optional<PropertyInfo> getInfoOptional (int propertyId)

public abstract void getInfos (Consumer<Map<Integer, PropertyInfo>> consumer)

Async fetch the property Infos

Parameters
consumer Callback with the PropertyInfo map

public abstract Map<Integer, PropertyInfo> getInfos ()

Get PropertyInfoMap stored in core library. Note that the first call to this method may be UI-blocking if a download is required

Returns
  • All PropertyInfos stored. See PropertyInfoMap

public abstract int getNumCachedProperties ()

Get the number of properties currently cached in memory

Returns
  • number of properties currently cached in memory

public abstract void getSearchEntityListByPropertyId (int propertyId, Consumer<List<SearchEntity>> callback)

Method to retrieve the list of SearchEntity by a propertyID

public abstract int getSelectedProperty ()

public abstract boolean isCached (int propertyId)

Checks whether a given property is cached in memory

Parameters
propertyId the property to test
Returns
  • Whether or not it is cached in memory

public abstract boolean removePropertyDownloadListener (PropertyDownloadManager.Listener listener)

remove listener

Parameters
listener the listener

public abstract boolean removeUnloadPropertyDataListener (CoreApi.UnloadPropertyDataListener listener)

remove listener

Parameters
listener the listener

public abstract void searchPoi (int propertyId, PoiFilter poiFilter, Consumer<List<? extends ISearchable>> resultCallback)

searches for points of interest based on given PoiFilter.

Parameters
propertyId propertyId
poiFilter poiFilter to filter the result by. If null, all results will be returned via the callback.
resultCallback callback for results

public abstract void setSelectedPropertyId (int propertyId)

public abstract void startDownload (int propertyId, PropertyDownloadManager.Listener listener)

Download a property map data. Use the listener to check status of download progress, failure or success.

Parameters
propertyId Property id to stop the download.
listener listener

public abstract void stopDownload (int propertyId)

Stop download property information.

Parameters
propertyId Property id to stop the download.

public abstract void unload (int propertyId, Consumer<Boolean> onComplete)

Unload property data from memory.

This will remove property data from database and from core library.

Note: If you are using map module as well, please call remove property data in MapstedMapApi.

Parameters
propertyId Property id that needs to be deleted.
onComplete Notified when unload is complete, returns success or failure