com.github.longdt.vertxservice.util.ShareableKeyMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vertx-service4j Show documentation
Show all versions of vertx-service4j Show documentation
A lightweight replacement for vertx-service-proxy. This library is highly optimized for vertx java
package com.github.longdt.vertxservice.util;
import io.vertx.core.shareddata.Shareable;
import java.util.HashMap;
import java.util.Map;
public class ShareableKeyMap implements Shareable {
private final Map data;
private ShareableKeyMap(Map data) {
this.data = data;
}
public static ShareableKeyMap of(Map data) {
return new ShareableKeyMap<>(data);
}
public Map unwrap() {
return data;
}
@SuppressWarnings("unchecked")
@Override
public ShareableKeyMap copy() {
Map copiedMap = new HashMap<>(data.size());
for (var entry : data.entrySet()) {
copiedMap.put((K) entry.getKey().copy(), entry.getValue());
}
return new ShareableKeyMap<>(copiedMap);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy