Class ProductionDate
-
- All Implemented Interfaces:
public final class ProductionDateContains the production date of the home power plant.
Expected is the string read from a de.jnkconsulting.e3dc.easyrscp.api.frame.tags.InfoTag.PRODUCTION_DATE data block. This should be in the format "KWXY YYYY". Where XY stands for the calendar week and YYYY for the four-digit year.
If the string cannot be interpreted because the format differs, the properties calendarWeek and year are set to -1. asLocalDate then returns LocalDate.MIN.
- Since:
2.0
-
-
Constructor Summary
Constructors Constructor Description ProductionDate(String rscpValue)
-
Method Summary
Modifier and Type Method Description final IntegergetCalendarWeek()Calendar week. final IntegergetYear()Four-digit year. final StringgetRscpValue()final LocalDateasLocalDate()Converts calendarWeek and year into a LocalDate object. StringtoString()-
-
Constructor Detail
-
ProductionDate
ProductionDate(String rscpValue)
- Parameters:
rscpValue- Value from a de.jnkconsulting.e3dc.easyrscp.api.frame.tags.InfoTag.PRODUCTION_DATE data block.
-
-
Method Detail
-
getCalendarWeek
final Integer getCalendarWeek()
Calendar week. If the calendar week could not be extracted from rscpValue, the value here is always -1
- Since:
2.0
-
getYear
final Integer getYear()
Four-digit year. If the year could not be extracted from rscpValue, the value here is always -1
- Since:
2.0
-
getRscpValue
final String getRscpValue()
-
asLocalDate
final LocalDate asLocalDate()
Converts calendarWeek and year into a LocalDate object. The first day of the calendar week is used as day.
If calendarWeek or year could not be extracted from the rscpValue, LocalDate.MIN is supplied.
- Returns:
calendarWeek and year as LocalDate with the first day of the week as LocalDate.getDayOfMonth. LocalDate.MIN is returned if the rscpValue could not be interpreted.
- Since:
2.0
-
-
-
-