The second step is to code the HealthCheck class. This class is a Plain Old Java Object (POJO). The model class is the template for the value object.
Open the project with your favorite IDE and, in the src/main/java/kioto directory, create a file called HealthCheck.java with the content of Listing 4.4.
The following is the content of Listing 4.4, HealthCheck.java:
package kioto;
import java.util.Date;
public final class HealthCheck {
private String event;
private String factory;
private String serialNumber;
private String type;
private String status;
private Date lastStartedAt;
private float temperature;
private String ipAddress;
}
Listing 4.4: HealthCheck.java
With your IDE, generate the following:
- A no-parameter constructor
- A constructor with all of the attributes passed as parameters
- The getters and the setters for each attribute
This is a data class...