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

io.vertx.up.uca.serialization.CollectionSaber Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package io.vertx.up.uca.serialization;

import io.vertx.core.json.JsonArray;
import io.vertx.up.fn.Fn;
import io.vertx.up.util.Ut;

/**
 * Enum
 */
public class CollectionSaber extends BaseSaber {
    @Override
    public  Object from(final T input) {
        return Fn.getNull(() -> {
            final String literal = Ut.serialize(input);
            return new JsonArray(literal);
        }, input);
    }

    @Override
    public Object from(final Class paramType,
                       final String literal) {
        // Default direct
        return Ut.deserialize(literal, paramType);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy