Fix some new errorprone warnings

Mostly javadoc related, but one (useless) method was entirely removed.

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2020-06-10 17:03:21 -06:00
rodzic cde1e3f60a
commit f6f3d256d7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
4 zmienionych plików z 160 dodań i 148 usunięć

Wyświetl plik

@ -75,7 +75,7 @@ public class DataAvailability {
jsonFile.setMaxAge(SEVEN_DAYS_IN_SECONDS);
jsonParser.next();
JsonObject jsonObject = jsonParser.getObject();
for (Entry<String, JsonValue> entry : jsonObject.entrySet()) {
for (Map.Entry<String, JsonValue> entry : jsonObject.entrySet()) {
Logging.debug("{0}: {1}", entry.getKey(), entry.getValue());
if (JsonValue.ValueType.OBJECT == entry.getValue().getValueType()
&& entry.getValue().asJsonObject().containsKey("countries")) {
@ -156,6 +156,8 @@ public class DataAvailability {
}
/**
* Get the global i nstance that should be used to check for data availability
*
* @return the unique instance
*/
public static DataAvailability getInstance() {
@ -167,6 +169,8 @@ public class DataAvailability {
}
/**
* Check if a bbox may have data
*
* @param bbox An area that may have data
* @return True if one of the corners of the {@code bbox} is in a country with
* available data.
@ -177,10 +181,13 @@ public class DataAvailability {
corners.add(new LatLon(bbox.getBottomRightLat(), bbox.getTopLeftLon()));
corners.add(bbox.getTopLeft());
corners.add(new LatLon(bbox.getTopLeftLat(), bbox.getBottomRightLon()));
corners.add(bbox.getCenter());
return corners.parallelStream().anyMatch(this::hasData);
}
/**
* Check if a latlon point may have data
*
* @param latLon A point that may have data from MapWithAI
* @return true if it is in an ares with data from MapWithAI
*/
@ -274,7 +281,7 @@ public class DataAvailability {
}
/**
* Set the URL to use to get MapWithAI information
* Set the URL to use to get MapWithAI information (`sources.json`)
*
* @param url The URL which serves MapWithAI servers
*/
@ -283,7 +290,9 @@ public class DataAvailability {
}
/**
* @param url The URL which serves MapWithAI servers
* Get the URL for the `sources.json`.
*
* @return The URL which serves MapWithAI servers
*/
public static String getReleaseUrl() {
return defaultServerUrl;

Wyświetl plik

@ -66,6 +66,8 @@ public final class MapWithAIPreferenceHelper {
}
/**
* Check if the user wants to merge buildings and addresses
*
* @return {@code true} if we want to automatically merge buildings with
* pre-existing addresses
*/
@ -74,6 +76,8 @@ public final class MapWithAIPreferenceHelper {
}
/**
* Check if the user wants to switch layers automatically after adding data.
*
* @return {@code true} if we want to automatically switch layers
*/
public static boolean isSwitchLayers() {
@ -85,6 +89,13 @@ public final class MapWithAIPreferenceHelper {
return returnBoolean;
}
/**
* Add a MapWithAI url. If both boolean parameters are false, nothing happens.
*
* @param info The info to add
* @param enabled If it should be enabled
* @param permanent If it should be added permanently
*/
public static void setMapWithAIUrl(MapWithAIInfo info, boolean enabled, boolean permanent) {
if (permanent && enabled) {
MapWithAILayerInfo.instance.add(info);
@ -162,6 +173,8 @@ public final class MapWithAIPreferenceHelper {
}
/**
* Get the tags to replace
*
* @return A map of tags to replacement tags (use {@link Tag#ofString} to parse)
*/
public static Map<String, String> getReplacementTags() {
@ -172,6 +185,8 @@ public final class MapWithAIPreferenceHelper {
}
/**
* Set the tags to replace
*
* @param tagsToReplace set the tags to replace
*/
public static void setReplacementTags(Map<String, String> tagsToReplace) {

Wyświetl plik

@ -25,7 +25,6 @@ import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds;
import org.openstreetmap.josm.data.imagery.Shape;
import org.openstreetmap.josm.data.sources.SourceInfo;
import org.openstreetmap.josm.data.sources.SourcePreferenceEntry;
import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo.MapWithAIPreferenceEntry;
import org.openstreetmap.josm.spi.preferences.Config;
import org.openstreetmap.josm.tools.CheckParameterUtil;
import org.openstreetmap.josm.tools.Logging;
@ -43,11 +42,12 @@ public class MapWithAIInfo extends
/**
* when adding a field, also adapt the: {@link #MapWithAIPreferenceEntry
* MapWithAIPreferenceEntry object}
* {@link #MapWithAIPreferenceEntry#MapWithAIPreferenceEntry(MapWithAIInfo)
* {@link MapWithAIPreferenceEntry#MapWithAIPreferenceEntry(MapWithAIInfo)
* MapWithAIPreferenceEntry constructor}
* {@link #MapWithAIInfo(MapWithAIPreferenceEntry) ImageryInfo constructor}
* {@link #MapWithAIInfo(ImageryInfo) MapWithAIInfo constructor}
* {@link #equalsPref(MapWithAIPreferenceEntry) equalsPref method}
* {@link MapWithAIInfo#MapWithAIInfo(MapWithAIPreferenceEntry) ImageryInfo
* constructor} {@link MapWithAIInfo#MapWithAIInfo(ImageryInfo) MapWithAIInfo
* constructor} {@link MapWithAIInfo#equalsPref(MapWithAIPreferenceEntry)
* equalsPref method}
**/
public static class MapWithAIPreferenceEntry extends SourcePreferenceEntry<MapWithAIInfo> {
@StructEntry
@ -64,7 +64,7 @@ public class MapWithAIInfo extends
String categories;
/**
* Constructs a new empty {@MapWithAIPreferenceEntry}
* Constructs a new empty {@link MapWithAIPreferenceEntry}
*/
public MapWithAIPreferenceEntry() {
// Do nothing
@ -369,13 +369,19 @@ public class MapWithAIInfo extends
}
/**
* @return The required replacement tags (run first)
* Get the requested tags to replace. These should be run before user requested
* replacements.
*
* @return The required replacement tags
*/
public Map<String, String> getReplacementTags() {
return replacementTags;
}
/**
* Set whether or not we should perform conflation using the specified
* conflation URL
*
* @param conflation If true, try to use the conflation URL
*/
public void setConflation(boolean conflation) {
@ -383,6 +389,8 @@ public class MapWithAIInfo extends
}
/**
* Set the URL to use for conflation purposes.
*
* @param conflationUrl Set the conflation url to use. null will disable, but
* you should use {@link MapWithAIInfo#setConflation}.
*/
@ -391,6 +399,8 @@ public class MapWithAIInfo extends
}
/**
* Set any parameters that are required/useful for the conflation URL
*
* @param parameters Set the conflation parameters
*/
public void setConflationParameters(JsonArray parameters) {
@ -407,6 +417,9 @@ public class MapWithAIInfo extends
}
/**
* Set additional categories (you can duplicate the primary category here, but
* you shouldn't)
*
* @return Any additional categories
*/
public List<MapWithAICategory> getAdditionalCategories() {

Wyświetl plik

@ -10,7 +10,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
@ -34,229 +33,221 @@ public final class Access {
ALL_TRANSPORT_TYPE("all"),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:access">Key:access</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:access">Key:access</a>
*/
ACCESS_KEY("access", ALL_TRANSPORT_TYPE),
// Access tag values
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dyes">Tag:access%3Dyes</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dyes">Tag:access%3Dyes</a>
*/
YES("yes"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dofficial">Tag:access%3Dofficial</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dofficial">Tag:access%3Dofficial</a>
*/
OFFICIAL("official"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Ddesignated">Tag:access%3Ddesignated</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Ddesignated">Tag:access%3Ddesignated</a>
*/
DESIGNATED("designated"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Ddestination">Tag:access%3Ddestination</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Ddestination">Tag:access%3Ddestination</a>
*/
DESTINATION("destination"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Ddelivery">Tag:access%3Ddelivery</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Ddelivery">Tag:access%3Ddelivery</a>
*/
DELIVERY("delivery"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dcustomers">Tag:access%3Dcustomers</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dcustomers">Tag:access%3Dcustomers</a>
*/
CUSTOMERS("customers"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dpermissive">Tag:access%3Dpermissive</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dpermissive">Tag:access%3Dpermissive</a>
*/
PERMISSIVE("permissive"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dagricultural">Tag:access%3Dagricultural</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dagricultural">Tag:access%3Dagricultural</a>
*/
AGRICULTURAL("agricultural"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dforestry">Tag:access%3Dforestry</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dforestry">Tag:access%3Dforestry</a>
*/
FORESTRY("forestry"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dprivate">Tag:access%3Dprivate</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dprivate">Tag:access%3Dprivate</a>
*/
PRIVATE("private"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dno">Tag:access%3Dno</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Dno">Tag:access%3Dno</a>
*/
NO("no"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Ddiscouraged">Tag:access%3Ddiscouraged</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Ddiscouraged">Tag:access%3Ddiscouraged</a>
*/
DISCOURAGED("discouraged"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Duse_sidepath">Tag:access%3Duse_sidepath</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Duse_sidepath">Tag:access%3Duse_sidepath</a>
*/
USE_SIDEPATH("use_sidepath"),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Ddismount">Tag:access%3Ddismount</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Tag:access%3Ddismount">Tag:access%3Ddismount</a>
*/
DISMOUNT("dismount"),
// Land
/** Land transport types */
LAND_TRANSPORT_TYPE("land", ALL_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:vehicle">Key:vehicle</a>
* <a href= "https://wiki.openstreetmap.org/wiki/Key:vehicle">Key:vehicle</a>
*/
VEHICLE("vehicle", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:motor_vehicle">Key:motor_vehicle</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:motor_vehicle">Key:motor_vehicle</a>
*/
MOTOR_VEHICLE("motor_vehicle", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:trailer">Key:trailer</a>
* <a href= "https://wiki.openstreetmap.org/wiki/Key:trailer">Key:trailer</a>
*/
TRAILER("trailer", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:foot">Key:foot</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:foot">Key:foot</a> */
FOOT("foot", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:ski">Key:ski</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:ski">Key:ski</a> */
SKI("ski", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:inline_skates">Key:inline_skates</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:inline_skates">Key:inline_skates</a>
*/
INLINE_SKATES("inline_skates", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:ice_skates">Key:ice_skates</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:ice_skates">Key:ice_skates</a>
*/
ICE_SKATES("ice_skates", LAND_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:horse">Key:horse</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:horse">Key:horse</a>
*/
HORSE("horse", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:bicycle">Key:bicycle</a>
* <a href= "https://wiki.openstreetmap.org/wiki/Key:bicycle">Key:bicycle</a>
*/
BICYCLE("bicycle", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:carriage">Key:carriage</a>
* <a href= "https://wiki.openstreetmap.org/wiki/Key:carriage">Key:carriage</a>
*/
CARRIAGE("carriage", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:caravan">Key:caravan</a>
* <a href= "https://wiki.openstreetmap.org/wiki/Key:caravan">Key:caravan</a>
*/
CARAVAN("caravan", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:motorcycle">Key:motorcycle</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:motorcycle">Key:motorcycle</a>
*/
MOTORCYCLE("motorcycle", LAND_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:moped">Key:moped</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:moped">Key:moped</a>
*/
MOPED("moped", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:mofa">Key:mofa</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:mofa">Key:mofa</a> */
MOFA("mofa", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:motorcar">Key:motorcar</a>
* <a href= "https://wiki.openstreetmap.org/wiki/Key:motorcar">Key:motorcar</a>
*/
MOTORCAR("motorcar", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:motorhome">Key:motorhome</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:motorhome">Key:motorhome</a>
*/
MOTORHOME("motorhome", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:psv">Key:psv</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:psv">Key:psv</a> */
PSV("psv", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:bus">Key:bus</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:bus">Key:bus</a> */
BUS("bus", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:taxi">Key:taxi</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:taxi">Key:taxi</a> */
TAXI("taxi", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:tourist_bus">Key:tourist_bus</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:tourist_bus">Key:tourist_bus</a>
*/
TOURIST_BUS("tourist_bus", LAND_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:goods">Key:goods</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:goods">Key:goods</a>
*/
GOODS("goods", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:hgv">Key:hgv</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:hgv">Key:hgv</a> */
HGV("hgv", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:atv">Key:atv</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:atv">Key:atv</a> */
ATV("atv", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:snowmobile">Key:snowmobile</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:snowmobile">Key:snowmobile</a>
*/
SNOWMOBILE("snowmobile", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:hgv_articulated">Key:hgv_articulated</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:hgv_articulated">Key:hgv_articulated</a>
*/
HGV_ARTICULATED("hgv_articulated", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:ski">Key:ski</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:ski">Key:ski</a> */
SKI_NORDIC("ski:nordic", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:ski">Key:ski</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:ski">Key:ski</a> */
SKI_ALPINE("ski:alpine", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:ski">Key:ski</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:ski">Key:ski</a> */
SKI_TELEMARK("ski:telemark", LAND_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:coach">Key:coach</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:coach">Key:coach</a>
*/
COACH("coach", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:golf_cart">Key:golf_cart</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:golf_cart">Key:golf_cart</a>
*/
GOLF_CART("golf_cart", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:minibus">Key:minibus</a>
* <a href= "https://wiki.openstreetmap.org/wiki/Key:minibus">Key:minibus</a>
*/
MINIBUS("minibus", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:share_taxi">Key:share_taxi</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:share_taxi">Key:share_taxi</a>
*/
SHARE_TAXI("share_taxi", LAND_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:hov">Key:hov</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:hov">Key:hov</a> */
HOV("hov", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:car_sharing">Key:car_sharing</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:car_sharing">Key:car_sharing</a>
*/
CAR_SHARING("car_sharing", LAND_TRANSPORT_TYPE),
/**
* Routers should default to {@code yes}, regardless of higher access rules,
* assuming it is navigatible by vehicle
*
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:emergency">Key:emergency</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:emergency">Key:emergency</a>
*/
EMERGENCY("emergency", LAND_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:hazmat">Key:hazmat</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:hazmat">Key:hazmat</a>
*/
HAZMAT("hazmat", LAND_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:disabled">Key:disabled</a>
* <a href= "https://wiki.openstreetmap.org/wiki/Key:disabled">Key:disabled</a>
*/
DISABLED("disabled", LAND_TRANSPORT_TYPE),
@ -264,71 +255,69 @@ public final class Access {
/** Water transport type */
WATER_TRANSPORT_TYPE("water", ALL_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:swimming">Key:swimming</a>
* <a href= "https://wiki.openstreetmap.org/wiki/Key:swimming">Key:swimming</a>
*/
SWIMMING("swimming", WATER_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:boat">Key:boat</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:boat">Key:boat</a> */
BOAT("boat", WATER_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:fishing_vessel">Key:fishing_vessel</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:fishing_vessel">Key:fishing_vessel</a>
*/
FISHING_VESSEL("fishing_vessel", WATER_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:ship">Key:ship</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:ship">Key:ship</a> */
SHIP("ship", WATER_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:motorboat">Key:motorboat</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:motorboat">Key:motorboat</a>
*/
MOTORBOAT("motorboat", WATER_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:sailboat">Key:sailboat</a>
* <a href= "https://wiki.openstreetmap.org/wiki/Key:sailboat">Key:sailboat</a>
*/
SAILBOAT("sailboat", WATER_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:canoe">Key:canoe</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:canoe">Key:canoe</a>
*/
CANOE("canoe", WATER_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:passenger">Key:passenger</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:passenger">Key:passenger</a>
*/
PASSENGER("passenger", WATER_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:cargo">Key:cargo</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:cargo">Key:cargo</a>
*/
CARGO("cargo", WATER_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:isps">Key:isps</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:isps">Key:isps</a> */
ISPS("isps", WATER_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:bulk">Key:bulk</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:bulk">Key:bulk</a> */
BULK("bulk", WATER_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:tanker">Key:tanker</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:tanker">Key:tanker</a>
*/
TANKER("tanker", WATER_TRANSPORT_TYPE),
/**
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:container">Key:container</a>
* <a href=
* "https://wiki.openstreetmap.org/wiki/Key:container">Key:container</a>
*/
CONTAINER("container", WATER_TRANSPORT_TYPE),
/** @see <a href="https://wiki.openstreetmap.org/wiki/Key:imdg">Key:imdg</a> */
/** <a href="https://wiki.openstreetmap.org/wiki/Key:imdg">Key:imdg</a> */
IMDG("imdg", WATER_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:tanker">Key:tanker</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:tanker">Key:tanker</a>
*/
TANKER_GAS("tanker:gas", WATER_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:tanker">Key:tanker</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:tanker">Key:tanker</a>
*/
TANKER_OIL("tanker:oil", WATER_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:tanker">Key:tanker</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:tanker">Key:tanker</a>
*/
TANKER_CHEMICAL("tanker:chemical", WATER_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:tanker">Key:tanker</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:tanker">Key:tanker</a>
*/
TANKER_SINGLEHULL("tanker:singlehull", WATER_TRANSPORT_TYPE),
@ -336,7 +325,7 @@ public final class Access {
/** Rail transport type */
RAIL_TRANSPORT_TYPE("rail", ALL_TRANSPORT_TYPE),
/**
* @see <a href="https://wiki.openstreetmap.org/wiki/Key:train">Key:train</a>
* <a href="https://wiki.openstreetmap.org/wiki/Key:train">Key:train</a>
*/
TRAIN("train", RAIL_TRANSPORT_TYPE);
@ -354,13 +343,17 @@ public final class Access {
}
/**
* @return The key for the enum
* Get the key for the enum
*
* @return The OpenStreetMap key
*/
public String getKey() {
return key;
}
/**
* Get the generic type of transport
*
* @return The AccessTags transport type
* (RAIL_TRANSPORT_TYPE/WATER_TRANSPORT_TYPE/etc)
*/
@ -452,8 +445,9 @@ public final class Access {
}
/**
* Create the default access inheritance, as defined at
* {@link "https://wiki.openstreetmap.org/wiki/Key:access#Transport_mode_restrictions"}
* Create the default access inheritance, as defined at <a href=
* "https://wiki.openstreetmap.org/wiki/Key:access#Transport_mode_restrictions">
* Key:access#Transport_mod_restrictions </a>
*/
private static void defaultInheritance() {
addMode(null, AccessTags.ACCESS_KEY);
@ -612,9 +606,8 @@ public final class Access {
/**
* Get the valid restriction values ({@code unknown} is not included). See
*
* @return Valid values for restrictions (unmodifiable)
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:access#List_of_possible_values">Key:access#List_of_possible_values</a>
* @return Valid values for restrictions (unmodifiable) <a href=
* "https://wiki.openstreetmap.org/wiki/Key:access#List_of_possible_values">Key:access#List_of_possible_values</a>
*/
public static Set<String> getRestrictionValues() {
return Collections.unmodifiableSet(RESTRICTION_VALUES);
@ -623,31 +616,13 @@ public final class Access {
/**
* Get the valid transport modes. See
*
* @return Value transport modes (unmodifiable)
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:access#Transport_mode_restrictions">Key:access#Transport_mode_restrictions</a>
* @return Value transport modes (unmodifiable) <a href=
* "https://wiki.openstreetmap.org/wiki/Key:access#Transport_mode_restrictions">Key:access#Transport_mode_restrictions</a>
*/
public static Set<String> getTransportModes() {
return Collections.unmodifiableSet(TRANSPORT_MODES);
}
/**
* Get the access method hierarchy.
*
* @return The hierarchy for access modes (unmodifiable)
* @see <a href=
* "https://wiki.openstreetmap.org/wiki/Key:access#Transport_mode_restrictions">Key:access#Transport_mode_restrictions</a>
*/
public static Map<String, Map<String, List<String>>> getAccessMethods() {
Map<String, Map<String, List<String>>> map = new HashMap<>();
for (Entry<String, Map<String, List<String>>> entry : map.entrySet()) {
Map<String, List<String>> tMap = new HashMap<>();
entry.getValue().forEach((key, list) -> tMap.put(key, Collections.unmodifiableList(list)));
map.put(entry.getKey(), Collections.unmodifiableMap(tMap));
}
return Collections.unmodifiableMap(map);
}
/**
* Get the implied access values for a primitive
*