com.github.longdt.vertxservice.util.ShareableList 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.ArrayList;
import java.util.List;
public class ShareableList implements Shareable {
private final List data;
private ShareableList(List data) {
this.data = data;
}
public static ShareableList of(List data) {
return new ShareableList<>(data);
}
public List unwrap() {
return data;
}
@SuppressWarnings("unchecked")
@Override
public ShareableList copy() {
List copiedList = new ArrayList<>(data.size());
for (var shareable : data) {
copiedList.add(shareable != null ? (E) shareable.copy() : null);
}
return new ShareableList<>(copiedList);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy