All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.graphhopper.routing.ev.MaxWeightExcept Maven / Gradle / Ivy

Go to download

GraphHopper is a fast and memory efficient Java road routing engine working seamlessly with OpenStreetMap data.

There is a newer version: 10.1
Show newest version
package com.graphhopper.routing.ev;

import com.graphhopper.util.Helper;

/**
 * When the max_weight EncodedValue is not legally binding. E.g. if there is a sign that a delivery vehicle can access
 * the road (even if larger than maxweight tag) then DELIVERY of this enum will be set.
 */
public enum MaxWeightExcept {

    NONE, DELIVERY, DESTINATION, FORESTRY;

    public static final String KEY = "max_weight_except";

    public static EnumEncodedValue create() {
        return new EnumEncodedValue<>(MaxWeightExcept.KEY, MaxWeightExcept.class);
    }

    @Override
    public String toString() {
        return Helper.toLowerCase(super.toString());
    }

    public static MaxWeightExcept find(String name) {
        if (name == null || name.isEmpty())
            return NONE;

        try {
            return MaxWeightExcept.valueOf(Helper.toUpperCase(name));
        } catch (IllegalArgumentException ex) {
            return NONE;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy