高效维护和操作允许列表

huangapple 未分类评论45阅读模式
英文:

Efficient way to maintain & operate AllowList

问题

我想维护一个允许列表,并将传入的 JSON 数据与允许列表进行比较,并处理满足条件的数据。在Java中,存储允许列表的高效格式是什么,以及高效的处理方式是什么?

允许列表

[
    {
        "index1": "data11",
        "index2": "data21"
    },
    {
        "index1": "data12",
        "index2": "data22"
    },
    {
        "index1": "data13",
        "index2": "data23"
    }
]

以下是传入的流数据

允许

{
    "index1": "data12",
    "index2": "data22",
    "index3": "data32"
}

现在允许

{
    "index1": "data12",
    "index2": "data21",
    "index3": "data32"
}

将其视为对 JSON 列表(传入数据)与 JSON 列表(允许列表)进行比较。

英文:

I want to maintain an AllowList and compare the incoming Json data with the AllowList and process the data which satisfies the condition. What is the efficient format to store the AllowList and efficient way to process in Java?

AllowList

[
	{
		"index1": "data11",
		"index2": "data21"
	},
	{
		"index1": "data12",
		"index2": "data22"
	},
	{
		"index1": "data13",
		"index2": "data23"
	}
]

Following is the incoming streaming data
Allowed

{
	"index1": "data12",
	"index2": "data22",
	"index3": "data32"
}

Now Allowed

{
	"index1": "data12",
	"index2": "data21",
	"index3": "data32"
}

Consider it as a comparison of List of JSON (incoming data) with list of JSON (Allow List)

huangapple
  • 本文由 发表于 2020年6月29日 06:30:34
  • 转载请务必保留本文链接:https://java.coder-hub.com/62628892.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定