Pojo / Entity对应于Azure REST API的json响应

时间:2018-03-29 05:58:12

标签: java json rest azure cloud

我编写了一个java类,它可以访问Azure REST API并获取json响应。例如下面 -

{
    "value": [
        {
            "sku": {
                "name": "Standard_LRS",
                "tier": "Standard"
            },
            "kind": "Storage",
            "id": "/subscriptions/cc60365e-3193-xxxx-b0f6-xxxxxxx/resourceGroups/WebServer-ubuntu/providers/Microsoft.Storage/storageAccounts/webserverubuntudiagxxx",
            "name": "webserverubuntudiag4xx",
            "type": "Microsoft.Storage/storageAccounts",
            "location": "eastus",
            "tags": {},
            "properties": {
                "networkAcls": {
                    "bypass": "AzureServices",
                    "virtualNetworkRules": [],
                    "ipRules": [],
                    "defaultAction": "Allow"
                },
                "trustedDirectories": [
                    "50228742-xxx-4cd2-xxx-3e50b7a62xx1"
                ],
                "supportsHttpsTrafficOnly": false,
                "encryption": {
                    "services": {
                        "file": {
                            "enabled": true,
                            "lastEnabledTime": "2018-03-26T15:02:26.8078850Z"
                        },
                        "blob": {
                            "enabled": true,
                            "lastEnabledTime": "2018-03-26T15:02:26.8078850Z"
                        }
                    },
                    "keySource": "Microsoft.Storage"
                },
                "provisioningState": "Succeeded",
                "creationTime": "2018-03-26T15:02:26.6359768Z",
                "primaryEndpoints": {
                    "blob": "https://webserverubuntudiagxx.blob.core.windows.net/",
                    "queue": "https://webserverubuntudiag4xx.queue.core.windows.net/",
                    "table": "https://webserverubuntudiagxx.table.core.windows.net/",
                    "file": "https://webserverubuntudiag4xx.file.core.windows.net/"
                },
                "primaryLocation": "eastus",
                "statusOfPrimary": "available"
            }
        }

    ]
}

我的问题是:是否有任何模型/ pojo / bean可用于将此json映射到java对象?

我需要将json上面的数据映射到java beans / pojos以显示到jsp页面,我是否需要单独创建自定义pojos或者Azure库/ sdk中是否有任何已知的?有什么建议吗?

0 个答案:

没有答案