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

com.github.longdt.vertxservice.util.Arguments 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;

public class Arguments implements Shareable {
    Object[] objects;

    Arguments() {
    }

    Arguments(Object... objects) {
        this.objects = objects;
    }

    public static Arguments of(Object... objects) {
        return new Arguments(objects);
    }

    @SuppressWarnings("unchecked")
    public  T getObject(int index) {
        return (T) objects[index];
    }

    @Override
    public Arguments copy() {
        Object[] copies = new Object[objects.length];
        Object obj;
        for (int i = 0; i < copies.length; ++i) {
            obj = objects[i];
            if (obj instanceof Shareable) {
                obj = ((Shareable) obj).copy();
            }
            copies[i] = obj;
        }
        return new Arguments(copies);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy