package cn.ibizlab.codegen.model;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import net.ibizsys.model.service.IPSSysServiceAPI;

import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

@Getter
@Setter
@NoArgsConstructor
@Accessors(chain = true)
public class test {

    private String type;

    @JsonIgnore
    @JSONField(serialize = false)
    private Map<String,Object> extensionparams=new HashMap<String,Object>();

    @JsonAnyGetter
    @JSONField(name = "_any", unwrapped = true, serialize = true, deserialize = false)
    public Map<String , Object> getExtensionparams() {
        return extensionparams;
    }

    @JsonAnySetter
    @JSONField(name = "_any", unwrapped = true, serialize = false, deserialize = true)
    public test set(String field, Object value) {
        extensionparams.put(field,value);
        return this;

    }

    public static void main(String[] args) {
        String str="{'a':'b','c':'d','type':'12'}";

        test t= JSON.parseObject(str,test.class);

        System.out.print(JSON.toJSONString(t));
    }

}
