Class OSHEntities

  • public final class OSHEntities
    extends Object
    • Method Detail

      • toList

        public static <T extends OSMEntity,​R> List<R> toList​(Iterable<T> versions,
                                                                   Function<T,​R> transformer)
        Collects all versions of an OSH entity from an iterable (OSHEntity.getVersions()) into a list after applying a transformation function.
        Type Parameters:
        T - the type of the OSM entities: OSMNode, OSMWay or OSMRelation
        R - the type of the returned list's items
        versions - the versions of an OSH entity, as returned from OSHEntity.getVersions()
        transformer - a function which is called for each version
        all versions of the OSH entity as a list, with the most recent version first.
      • getByTimestamp

        public static OSMEntity getByTimestamp​(OSHEntity osh,
                                               OSHDBTimestamp timestamp)
        Returns the OSM entity ("version") of the OSH entity which was current at the given timestamp.
        osh - the OSH entity to process.
        timestamp - the timestamp for which to return the state of the OSH entity.
        the version (OSM entity) of the OSH entity which was current at the given timestamp or null if none could be found.