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