From 58d8edf48e24d5a6cffcc48fd2c12aa31e3e1d9c Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Mon, 10 Oct 2022 18:12:36 +0200 Subject: [PATCH] Add shortcut methods to MarkerSet --- .../bluemap/api/markers/MarkerSet.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/main/java/de/bluecolored/bluemap/api/markers/MarkerSet.java b/src/main/java/de/bluecolored/bluemap/api/markers/MarkerSet.java index 56a0ad3..bd76914 100644 --- a/src/main/java/de/bluecolored/bluemap/api/markers/MarkerSet.java +++ b/src/main/java/de/bluecolored/bluemap/api/markers/MarkerSet.java @@ -159,6 +159,33 @@ public Map getMarkers() { return markers; } + /** + * Convenience method to add a {@link Marker} to this {@link MarkerSet}.
+ * Shortcut for: getMarkers().get(String) + * @see Map#get(Object) + */ + public Marker get(String key) { + return getMarkers().get(key); + } + + /** + * Convenience method to add a {@link Marker} to this {@link MarkerSet}.
+ * Shortcut for: getMarkers().put(String,Marker) + * @see Map#put(Object, Object) + */ + public Marker put(String key, Marker marker) { + return getMarkers().put(key, marker); + } + + /** + * Convenience method to remove a {@link Marker} from this {@link MarkerSet}.
+ * Shortcut for: getMarkers().remove(String) + * @see Map#remove(Object) + */ + public Marker remove(String key) { + return getMarkers().remove(key); + } + @Override public boolean equals(Object o) { if (this == o) return true;