package com.navercorp.pinpoint.web.vo.agent;

import com.fasterxml.jackson.annotation.JsonUnwrapped;
import com.navercorp.pinpoint.common.server.bo.JvmInfoBo;
import com.navercorp.pinpoint.common.server.bo.ServerMetaDataBo;

import java.util.Objects;

/**
 * @author Woonduk Kang(emeroad)
 */
public class DetailedAgentInfo {
    private final AgentInfo agentInfo;
    private final ServerMetaDataBo serverMetaData;
    private final JvmInfoBo jvmInfo;

    public DetailedAgentInfo(AgentInfo agentInfo, ServerMetaDataBo serverMetaData, JvmInfoBo jvmInfo) {
        this.agentInfo = Objects.requireNonNull(agentInfo, "agentInfo");
        this.serverMetaData = Objects.requireNonNull(serverMetaData, "serverMetaData");
        this.jvmInfo = Objects.requireNonNull(jvmInfo, "jvmInfo");
    }

    @JsonUnwrapped
    public AgentInfo getAgentInfo() {
        return agentInfo;
    }

    public ServerMetaDataBo getServerMetaData() {
        return serverMetaData;
    }

    public JvmInfoBo getJvmInfo() {
        return jvmInfo;
    }
}

@@ -218,16 +218,50 @@
 ataBo;%0A%0A
+import javax.annotation.Nullable;%0A
 import j
@@ -530,16 +530,26 @@
 entInfo,
+ @Nullable
  ServerM
@@ -573,16 +573,26 @@
 etaData,
+ @Nullable
  JvmInfo
@@ -712,131 +712,54 @@
 a = 
-Objects.requireNonNull(serverMetaData, %22serverMetaData%22);%0A        this.jvmInfo = Objects.requireNonNull(jvmInfo, %22jvmInfo%22)
+serverMetaData;%0A        this.jvmInfo = jvmInfo
 ;%0A  

Fix NPE of JVMInfo in DetailedAgentInfo