public static byte[] serialize(HostInfo hostInfo) {
        if (!hostInfo.status().isSuspended()) {
            throw new IllegalArgumentException("Serialization of unsuspended status is not supported: " + hostInfo.status());
        }

        WireHostInfo wireHostInfo = new WireHostInfo();
        wireHostInfo.status = hostInfo.status().name();
        wireHostInfo.suspendedSinceInMillis = hostInfo.suspendedSince().get().toEpochMilli();

        return uncheck(() -> mapper.writeValueAsBytes(wireHostInfo));
    }
Handles serialization/deserialization of HostInfo to/from byte array.

@author hakonhall
orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/json/WireHostInfo.java