@Override public AgentInfo build() { return new AgentInfo(this); }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public String toString() { return ToString.builder("AgentInfo").add("AgentId", agentId()).add("HostName", hostName()) .add("AgentNetworkInfoList", agentNetworkInfoList()).add("ConnectorId", connectorId()).add("Version", version()) .add("Health", healthAsString()).add("LastHealthPingTime", lastHealthPingTime()) .add("CollectionStatus", collectionStatus()).add("AgentType", agentType()) .add("RegisteredTime", registeredTime()).build(); }
@Override @SafeVarargs public final Builder agentsInfo(Consumer<AgentInfo.Builder>... agentsInfo) { agentsInfo(Stream.of(agentsInfo).map(c -> AgentInfo.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; }
@Override @SafeVarargs public final Builder agentsInfo(Consumer<AgentInfo.Builder>... agentsInfo) { agentsInfo(Stream.of(agentsInfo).map(c -> AgentInfo.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public String toString() { return ToString.builder("AgentInfo").add("AgentId", agentId()).add("HostName", hostName()) .add("AgentNetworkInfoList", agentNetworkInfoList()).add("ConnectorId", connectorId()).add("Version", version()) .add("Health", healthAsString()).add("LastHealthPingTime", lastHealthPingTime()) .add("CollectionStatus", collectionStatus()).add("AgentType", agentType()) .add("RegisteredTime", registeredTime()).build(); }
@Override @SafeVarargs public final Builder agentsInfo(Consumer<AgentInfo.Builder>... agentsInfo) { agentsInfo(Stream.of(agentsInfo).map(c -> AgentInfo.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; }
@Override public AgentInfo build() { return new AgentInfo(this); } }
@Override public String toString() { return ToString.builder("AgentInfo").add("AgentId", agentId()).add("HostName", hostName()) .add("AgentNetworkInfoList", agentNetworkInfoList()).add("ConnectorId", connectorId()).add("Version", version()) .add("Health", healthAsString()).add("LastHealthPingTime", lastHealthPingTime()) .add("CollectionStatus", collectionStatus()).add("AgentType", agentType()) .add("RegisteredTime", registeredTime()).build(); }
public AgentInfo unmarshall(JsonUnmarshallerContext context) throws Exception { AgentInfo.Builder agentInfoBuilder = AgentInfo.builder();
@Override public AgentInfo build() { return new AgentInfo(this); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(agentId()); hashCode = 31 * hashCode + Objects.hashCode(hostName()); hashCode = 31 * hashCode + Objects.hashCode(agentNetworkInfoList()); hashCode = 31 * hashCode + Objects.hashCode(connectorId()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(healthAsString()); hashCode = 31 * hashCode + Objects.hashCode(lastHealthPingTime()); hashCode = 31 * hashCode + Objects.hashCode(collectionStatus()); hashCode = 31 * hashCode + Objects.hashCode(agentType()); hashCode = 31 * hashCode + Objects.hashCode(registeredTime()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AgentInfo)) { return false; } AgentInfo other = (AgentInfo) obj; return Objects.equals(agentId(), other.agentId()) && Objects.equals(hostName(), other.hostName()) && Objects.equals(agentNetworkInfoList(), other.agentNetworkInfoList()) && Objects.equals(connectorId(), other.connectorId()) && Objects.equals(version(), other.version()) && Objects.equals(healthAsString(), other.healthAsString()) && Objects.equals(lastHealthPingTime(), other.lastHealthPingTime()) && Objects.equals(collectionStatus(), other.collectionStatus()) && Objects.equals(agentType(), other.agentType()) && Objects.equals(registeredTime(), other.registeredTime()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AgentInfo)) { return false; } AgentInfo other = (AgentInfo) obj; return Objects.equals(agentId(), other.agentId()) && Objects.equals(hostName(), other.hostName()) && Objects.equals(agentNetworkInfoList(), other.agentNetworkInfoList()) && Objects.equals(connectorId(), other.connectorId()) && Objects.equals(version(), other.version()) && Objects.equals(healthAsString(), other.healthAsString()) && Objects.equals(lastHealthPingTime(), other.lastHealthPingTime()) && Objects.equals(collectionStatus(), other.collectionStatus()) && Objects.equals(agentType(), other.agentType()) && Objects.equals(registeredTime(), other.registeredTime()); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(agentId()); hashCode = 31 * hashCode + Objects.hashCode(hostName()); hashCode = 31 * hashCode + Objects.hashCode(agentNetworkInfoList()); hashCode = 31 * hashCode + Objects.hashCode(connectorId()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(healthAsString()); hashCode = 31 * hashCode + Objects.hashCode(lastHealthPingTime()); hashCode = 31 * hashCode + Objects.hashCode(collectionStatus()); hashCode = 31 * hashCode + Objects.hashCode(agentType()); hashCode = 31 * hashCode + Objects.hashCode(registeredTime()); return hashCode; }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(agentId()); hashCode = 31 * hashCode + Objects.hashCode(hostName()); hashCode = 31 * hashCode + Objects.hashCode(agentNetworkInfoList()); hashCode = 31 * hashCode + Objects.hashCode(connectorId()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(healthAsString()); hashCode = 31 * hashCode + Objects.hashCode(lastHealthPingTime()); hashCode = 31 * hashCode + Objects.hashCode(collectionStatus()); hashCode = 31 * hashCode + Objects.hashCode(agentType()); hashCode = 31 * hashCode + Objects.hashCode(registeredTime()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AgentInfo)) { return false; } AgentInfo other = (AgentInfo) obj; return Objects.equals(agentId(), other.agentId()) && Objects.equals(hostName(), other.hostName()) && Objects.equals(agentNetworkInfoList(), other.agentNetworkInfoList()) && Objects.equals(connectorId(), other.connectorId()) && Objects.equals(version(), other.version()) && Objects.equals(healthAsString(), other.healthAsString()) && Objects.equals(lastHealthPingTime(), other.lastHealthPingTime()) && Objects.equals(collectionStatus(), other.collectionStatus()) && Objects.equals(agentType(), other.agentType()) && Objects.equals(registeredTime(), other.registeredTime()); }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "agentId": return Optional.ofNullable(clazz.cast(agentId())); case "hostName": return Optional.ofNullable(clazz.cast(hostName())); case "agentNetworkInfoList": return Optional.ofNullable(clazz.cast(agentNetworkInfoList())); case "connectorId": return Optional.ofNullable(clazz.cast(connectorId())); case "version": return Optional.ofNullable(clazz.cast(version())); case "health": return Optional.ofNullable(clazz.cast(healthAsString())); case "lastHealthPingTime": return Optional.ofNullable(clazz.cast(lastHealthPingTime())); case "collectionStatus": return Optional.ofNullable(clazz.cast(collectionStatus())); case "agentType": return Optional.ofNullable(clazz.cast(agentType())); case "registeredTime": return Optional.ofNullable(clazz.cast(registeredTime())); default: return Optional.empty(); } }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "agentId": return Optional.ofNullable(clazz.cast(agentId())); case "hostName": return Optional.ofNullable(clazz.cast(hostName())); case "agentNetworkInfoList": return Optional.ofNullable(clazz.cast(agentNetworkInfoList())); case "connectorId": return Optional.ofNullable(clazz.cast(connectorId())); case "version": return Optional.ofNullable(clazz.cast(version())); case "health": return Optional.ofNullable(clazz.cast(healthAsString())); case "lastHealthPingTime": return Optional.ofNullable(clazz.cast(lastHealthPingTime())); case "collectionStatus": return Optional.ofNullable(clazz.cast(collectionStatus())); case "agentType": return Optional.ofNullable(clazz.cast(agentType())); case "registeredTime": return Optional.ofNullable(clazz.cast(registeredTime())); default: return Optional.empty(); } }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "agentId": return Optional.ofNullable(clazz.cast(agentId())); case "hostName": return Optional.ofNullable(clazz.cast(hostName())); case "agentNetworkInfoList": return Optional.ofNullable(clazz.cast(agentNetworkInfoList())); case "connectorId": return Optional.ofNullable(clazz.cast(connectorId())); case "version": return Optional.ofNullable(clazz.cast(version())); case "health": return Optional.ofNullable(clazz.cast(healthAsString())); case "lastHealthPingTime": return Optional.ofNullable(clazz.cast(lastHealthPingTime())); case "collectionStatus": return Optional.ofNullable(clazz.cast(collectionStatus())); case "agentType": return Optional.ofNullable(clazz.cast(agentType())); case "registeredTime": return Optional.ofNullable(clazz.cast(registeredTime())); default: return Optional.empty(); } }
/** * Marshall the given parameter object */ public void marshall(AgentInfo agentInfo, ProtocolMarshaller protocolMarshaller) { Validate.paramNotNull(agentInfo, "agentInfo"); Validate.paramNotNull(protocolMarshaller, "protocolMarshaller"); try { protocolMarshaller.marshall(agentInfo.agentId(), AGENTID_BINDING); protocolMarshaller.marshall(agentInfo.hostName(), HOSTNAME_BINDING); protocolMarshaller.marshall(agentInfo.agentNetworkInfoList(), AGENTNETWORKINFOLIST_BINDING); protocolMarshaller.marshall(agentInfo.connectorId(), CONNECTORID_BINDING); protocolMarshaller.marshall(agentInfo.version(), VERSION_BINDING); protocolMarshaller.marshall(agentInfo.healthAsString(), HEALTH_BINDING); protocolMarshaller.marshall(agentInfo.lastHealthPingTime(), LASTHEALTHPINGTIME_BINDING); protocolMarshaller.marshall(agentInfo.collectionStatus(), COLLECTIONSTATUS_BINDING); protocolMarshaller.marshall(agentInfo.agentType(), AGENTTYPE_BINDING); protocolMarshaller.marshall(agentInfo.registeredTime(), REGISTEREDTIME_BINDING); } catch (Exception e) { throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build(); } } }