org.entur.netex.index.api.VersionedNetexEntityIndex Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of netex-parser-java Show documentation
Show all versions of netex-parser-java Show documentation
Library for parsing NeTEx files and looking up entities in an index.
package org.entur.netex.index.api;
import org.rutebanken.netex.model.EntityStructure;
import java.util.Collection;
import java.util.Map;
/**
* An index of versioned NeTEx entities
* @param
*/
public interface VersionedNetexEntityIndex {
/**
* Return the element with the latest version with the given {@code id}. Returns
* {@code null} if no element is found.
*/
V getLatestVersion(String id);
/**
* Return the element with the given {@code id} and {@code version}. Returns
* {@code null} if no element is found
* @param id
* @param version
* @return
*/
V getVersion(String id, String version);
/**
* Return the latest version of all entities
* @return
*/
Collection getLatestVersions();
/**
* Lookup all versions of element with the given {@code id}.
*
* @return an empty collection if no elements are found.
*/
Collection getAllVersions(String id);
/**
* Get all versions of all entities
* @return
*/
Map> getAllVersions();
/**
* Put all versions of an entity into the index.
* If the entity already exists in the index, all versions
* will be replaced.
*
* @param id
* @param entities
*/
void put(String id, Collection entities);
/**
* Put all entities into the collection
* If an entity already exists in the index, all versions
* will be replaced.
* @param entities
*/
void putAll(Collection entities);
/**
* Remove all versions of an entity from the index given its id
*/
void remove(String id);
}