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

com.aliyun.openservices.log.common.IngestionGeneralSource Maven / Gradle / Ivy

There is a newer version: 0.6.115
Show newest version
package com.aliyun.openservices.log.common;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONType;

import java.util.HashMap;
import java.util.Map;


@JSONType(serializer = ToGeneralSerializer.class)
public class IngestionGeneralSource extends DataSource {

    private Map fields = new HashMap();

    public IngestionGeneralSource() {
        super(DataSourceType.GENERAL);
    }

    public Map getFields() {
        return fields;
    }

    public void setFields(Map fields) {
        this.fields = fields;
    }

    public Object get(String key) {
        return fields.get(key);
    }

    public void put(String key, Object value) {
        fields.put(key, value);
    }

    @Override
    public void deserialize(JSONObject jsonObject) {
        super.deserialize(jsonObject);
        for (String field : jsonObject.keySet()) {
            put(field, jsonObject.get(field));
        }
    }

    @Override
    public String toString() {
        return JSONObject.toJSONString(fields);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy