All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.longdt.vertxservice.util.ShareableList Maven / Gradle / Ivy

Go to download

A lightweight replacement for vertx-service-proxy. This library is highly optimized for vertx java

There is a newer version: 1.1.1
Show newest version
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