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

io.vertx.up.uca.rs.mime.parse.StandardAtomic Maven / Gradle / Ivy

The newest version!
package io.vertx.up.uca.rs.mime.parse;

import io.vertx.ext.web.RoutingContext;
import io.vertx.up.atom.Epsilon;
import io.horizon.exception.WebException;
import io.vertx.up.uca.rs.Filler;

import java.util.function.Supplier;

@SuppressWarnings("unchecked")
public class StandardAtomic implements Atomic {

    @Override
    public Epsilon ingest(final RoutingContext context,
                             final Epsilon income)
        throws WebException {
        final Supplier fillerFn = Filler.PARAMS.get(income.getAnnotation().annotationType());
        final Filler filler = fillerFn.get();
        final Object value = filler.apply(income.getName(), income.getArgType(), context);
        return null == value ? income.setValue(null) : income.setValue((T) value);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy