com.github.longdt.vertxservice.util.ShareableMap 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 ShareableMap implements Shareable {
private final Map data;
private ShareableMap(Map data) {
this.data = data;
}
public static ShareableMap of(Map data) {
return new ShareableMap<>(data);
}
public Map unwrap() {
return data;
}
@SuppressWarnings("unchecked")
@Override
public ShareableMap copy() {
Map copiedMap = new HashMap<>(data.size());
for (var entry : data.entrySet()) {
copiedMap.put((K) entry.getKey().copy(), (V) entry.getValue().copy());
}
return new ShareableMap<>(copiedMap);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy