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

com.foreveross.springboot.dubbo.utils.Payload Maven / Gradle / Ivy

There is a newer version: 2.3.8
Show newest version
package com.foreveross.springboot.dubbo.utils;


import org.codehaus.jackson.annotate.JsonProperty;
import org.springframework.beans.factory.annotation.Value;

import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.UUID;

public class Payload implements Serializable {

    private static final long serialVersionUID = -1549643581827130116L;

    @JsonProperty("payload")
    private Object payload;

    @JsonProperty("request_id")
    @Value("${dubbox.service.request_id}")
    private String request_id = UUID.randomUUID().toString();

    private JsonFilterConfig mapper;

    public Payload() {}

    public Payload(Object payload) {
        this.payload = payload;
    }


    public Object getPayload() throws IOException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, NoSuchFieldException {
        return this.mapper.filteredWriter(this.payload);
    }

    public void setPayload(Object payload) {
        this.payload = payload;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy