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

co.spraybot.messagerunner.builders.DataStoreParcelBuilder Maven / Gradle / Ivy

Go to download

A micro-framework to allow easily passing specific Vert.x messages to specific addresses for processing of those messages.

The newest version!
package co.spraybot.messagerunner.builders;

import co.spraybot.messagerunner.DataStoreVerticle;
import co.spraybot.messagerunner.DataStoreParcel;
import co.spraybot.messagerunner.parcels.DefaultDataStoreParcel;

public class DataStoreParcelBuilder {

    private String key;
    private DataStoreVerticle.Operation operation;
    private Object value;
    private Class valueType;

    public DataStoreParcelBuilder key(String key) {
        this.key = key;
        return this;
    }

    public DataStoreParcelBuilder operation(DataStoreVerticle.Operation operation) {
        this.operation = operation;
        return this;
    }

    public DataStoreParcelBuilder value(Object value) {
        this.value = value;
        if (value != null) {
            valueType = value.getClass();
        }
        return this;
    }

    public  DefaultDataStoreParcel build() {
        DefaultDataStoreParcel parcel = new DefaultDataStoreParcel<>(key, operation, value, valueType);

        operation = null;
        key = null;
        value = null;

        return parcel;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy