Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Temperature pojo and adjusted Esper statements accordingly
- Loading branch information
1 parent
8b9b9a6
commit ce571b9
Showing
5 changed files
with
44 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,52 @@ | ||
package com.cor.cep.event; | ||
|
||
import java.util.Date; | ||
|
||
/** | ||
* Immutable Temperature Event class. The process control system creates these events. The | ||
* TemperatureEventHandler picks these up and processes them. | ||
*/ | ||
public class TemperatureEvent { | ||
|
||
private int value; | ||
|
||
public TemperatureEvent(int value) { | ||
this.value = value; | ||
/** Temperature in Celcius. */ | ||
private int temperature; | ||
|
||
/** Time temerature reading was taken. */ | ||
private Date timeOfReading; | ||
|
||
/** | ||
* Single value constructor. | ||
* @param value Temperature in Celsius. | ||
*/ | ||
/** | ||
* Temeratur constructor. | ||
* @param temperature Temperature in Celsius | ||
* @param timeOfReading Time of Reading | ||
*/ | ||
public TemperatureEvent(int temperature, Date timeOfReading) { | ||
this.temperature = temperature; | ||
this.timeOfReading = timeOfReading; | ||
} | ||
|
||
public int getValue() { | ||
return value; | ||
/** | ||
* Get the Temperature. | ||
* @return Temperature in Celsius | ||
*/ | ||
public int getTemperature() { | ||
return temperature; | ||
} | ||
|
||
/** | ||
* Get time Temperature reading was taken. | ||
* @return Time of Reading | ||
*/ | ||
public Date getTimeOfReading() { | ||
return timeOfReading; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "TemperatureEvent [" + value + "C]"; | ||
return "TemperatureEvent [" + temperature + "C]"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters