Package net.solarnetwork.ocpp.domain
Class ChargingSchedulePeriodInfo
java.lang.Object
net.solarnetwork.ocpp.domain.ChargingSchedulePeriodInfo
- All Implemented Interfaces:
net.solarnetwork.domain.Differentiable<ChargingSchedulePeriodInfo>
public class ChargingSchedulePeriodInfo
extends Object
implements net.solarnetwork.domain.Differentiable<ChargingSchedulePeriodInfo>
Information about a charging schedule period.
- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ChargingSchedulePeriodInfo(Duration startOffset, BigDecimal rateLimit) Constructor.ChargingSchedulePeriodInfo(Duration startOffset, BigDecimal rateLimit, Integer numPhases) Constructor.Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanGet the number of phases.Get the rate limit.Get the start offset.intGet the start offset, in seconds.inthashCode()booleanTest if the properties of another entity are the same as in this instance.voidsetNumPhases(Integer numPhases) Set the number of phases.voidsetRateLimit(BigDecimal rateLimit) Set the rate limit.voidsetStartOffset(Duration startOffset) Set the start offset.voidsetStartOffsetSeconds(int seconds) Set the start offset, in seconds.toString()
-
Constructor Details
-
ChargingSchedulePeriodInfo
public ChargingSchedulePeriodInfo()Default constructor.This rate limit is set to zero.
-
ChargingSchedulePeriodInfo
Constructor.- Parameters:
startOffset- the start offset from the start of the schedulerateLimit- the rate limit- Throws:
IllegalArgumentException- ifstartOffsetorrateLimitare null
-
ChargingSchedulePeriodInfo
Constructor.- Parameters:
startOffset- the start offset from the start of the schedulerateLimit- the rate limitnumPhases- the optional number of phases- Throws:
IllegalArgumentException- ifstartOffsetorrateLimitare null
-
ChargingSchedulePeriodInfo
Copy constructor.- Parameters:
other- the other 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<ChargingSchedulePeriodInfo>
-
hashCode
public int hashCode() -
equals
-
toString
-
getStartOffset
Get the start offset.- Returns:
- the offset from the start of the schedule; never null
-
setStartOffset
Set the start offset.- Parameters:
startOffset- the offset from the start of the schedule to set- Throws:
IllegalArgumentException- ifstartOffsetis null
-
getStartOffsetSeconds
public int getStartOffsetSeconds()Get the start offset, in seconds.- Returns:
- the offset from the start of the schedule
-
setStartOffsetSeconds
public void setStartOffsetSeconds(int seconds) Set the start offset, in seconds.- Parameters:
seconds- the seconds
-
getRateLimit
Get the rate limit.- Returns:
- the limit; never null
-
setRateLimit
Set the rate limit.- Parameters:
rateLimit- the limit to set- Throws:
IllegalArgumentException- ifrateLimitis null
-
getNumPhases
Get the number of phases.- Returns:
- the phase count, or null if not applicable (e.g. DC charging)
-
setNumPhases
Set the number of phases.- Parameters:
numPhases- the phase count to set
-