From f3bec4ebaccc1dc095a49f4d8e500e0cacfa6f0b Mon Sep 17 00:00:00 2001 From: leventov Date: Tue, 13 Oct 2015 15:28:12 +0300 Subject: [PATCH] Add ChronicleMap.of() as a shortcut to ChronicleMapBuilder.of() --- .../net/openhft/chronicle/map/ChronicleMap.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/net/openhft/chronicle/map/ChronicleMap.java b/src/main/java/net/openhft/chronicle/map/ChronicleMap.java index 2b698484f..2c6d70bb8 100755 --- a/src/main/java/net/openhft/chronicle/map/ChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/ChronicleMap.java @@ -55,6 +55,19 @@ public interface ChronicleMap extends ConcurrentMap, ChronicleHash, MapSegmentContext, ExternalMapQueryContext> { + /** + * Delegates to {@link ChronicleMapBuilder#of(Class, Class)} for convenience. + * + * @param keyClass class of the key type of the Chronicle Map to create + * @param valueClass class of the value type of the Chronicle Map to create + * @param the key type of the Chronicle Map to create + * @param the value type of the Chronicle Map to create + * @return a new {@code ChronicleMapBuilder} for the given key and value classes + */ + static ChronicleMapBuilder of(Class keyClass, Class valueClass) { + return ChronicleMapBuilder.of(keyClass, valueClass); + } + /** * Returns the value to which the specified key is mapped, or {@code null} if this map contains * no mapping for the key.