Package net.solarnetwork.ocpp.domain
Class ChargingScheduleInfo
java.lang.Object
net.solarnetwork.ocpp.domain.ChargingScheduleInfo
- All Implemented Interfaces:
net.solarnetwork.domain.Differentiable<ChargingScheduleInfo>
public class ChargingScheduleInfo
extends Object
implements net.solarnetwork.domain.Differentiable<ChargingScheduleInfo>
Information about a charging schedule.
- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionChargingScheduleInfo(Duration duration, Instant start, UnitOfMeasure rateUnit, BigDecimal minRate) Constructor.Copy constructor.ChargingScheduleInfo(UnitOfMeasure rateUnit) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPeriod(ChargingSchedulePeriodInfo period) Add a period.booleandiffersFrom(ChargingScheduleInfo other) Get the duration.intGet the duration, as seconds.Get the periods list.intGet the count of entity entities.Get the charging rate unit to use for the configuredgetPeriods().intGet the charging rate unit, as a code value.getStart()Get the start time.Get the start date as a formatted instant.booleanisSameAs(ChargingScheduleInfo other) Test if the properties of another entity are the same as in this instance.voidsetDuration(Duration duration) Set the duration.voidsetDurationSeconds(int seconds) Set the duration, as seconds.voidsetMinRate(BigDecimal minRate) voidsetPeriods(List<ChargingSchedulePeriodInfo> periods) Set the periods list.voidsetPeriodsCount(int count) Adjust the number of configured entity entities.voidsetRateUnit(UnitOfMeasure rateUnit) Set the charging rate unit to use for the configuredgetPeriods().voidsetRateUnitCode(int code) Set the rate unit as a code value.voidSet the start time.voidsetStartValue(String value) Set the start date as an ISO 8601 formatted timestamp.toString()
-
Constructor Details
-
ChargingScheduleInfo
Constructor.- Parameters:
rateUnit- the rate unit- Throws:
IllegalArgumentException- ifrateUnitis null
-
ChargingScheduleInfo
public ChargingScheduleInfo(Duration duration, Instant start, UnitOfMeasure rateUnit, BigDecimal minRate) Constructor.- Parameters:
duration- the schedule durationstart- the schedule start timerateUnit- the rate unitminRate- the minimum charge rate- Throws:
IllegalArgumentException- ifrateUnitis null
-
ChargingScheduleInfo
Copy constructor.- Parameters:
other- the info to copy
-
-
Method Details
-
isSameAs
Test if the properties of another entity are the same as in this instance.- Parameters:
other- the other entity to compare to- Returns:
- true if the properties of this instance are equal to the other
-
differsFrom
- Specified by:
differsFromin interfacenet.solarnetwork.domain.Differentiable<ChargingScheduleInfo>
-
toString
-
getDuration
Get the duration.- Returns:
- the duration
-
setDuration
Set the duration.- Parameters:
duration- the duration to set
-
getDurationSeconds
public int getDurationSeconds()Get the duration, as seconds.- Returns:
- the duration seconds
-
setDurationSeconds
public void setDurationSeconds(int seconds) Set the duration, as seconds.If
secondsis less than 1 then a nullDurationwill be set.- Parameters:
seconds- the duration
-
getStart
Get the start time.- Returns:
- the start
-
setStart
Set the start time.- Parameters:
start- the start to set
-
getStartValue
Get the start date as a formatted instant.- Returns:
- the date, as an ISO 8601 formatted string
-
setStartValue
Set the start date as an ISO 8601 formatted timestamp.- Parameters:
value- the date string
-
getRateUnit
Get the charging rate unit to use for the configuredgetPeriods().- Returns:
- the unit, never null
-
setRateUnit
Set the charging rate unit to use for the configuredgetPeriods().- Parameters:
rateUnit- the unit to set- Throws:
IllegalArgumentException- ifrateUnitis null
-
getRateUnitCode
public int getRateUnitCode()Get the charging rate unit, as a code value.- Returns:
- the rate code
-
setRateUnitCode
public void setRateUnitCode(int code) Set the rate unit as a code value.- Parameters:
code- the code value
-
getMinRate
- Returns:
- the minRate
-
setMinRate
- Parameters:
minRate- the minRate to set
-
addPeriod
Add a period.- Parameters:
period- the period to add
-
getPeriods
Get the periods list.- Returns:
- the periods
-
setPeriods
Set the periods list.- Parameters:
periods- the periods to set
-
getPeriodsCount
public int getPeriodsCount()Get the count of entity entities.- Returns:
- the configuration count
-
setPeriodsCount
public void setPeriodsCount(int count) Adjust the number of configured entity entities.- Parameters:
count- the desired number of elements
-