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 Details

    • ChargingScheduleInfo

      public ChargingScheduleInfo(UnitOfMeasure rateUnit)
      Constructor.
      Parameters:
      rateUnit - the rate unit
      Throws:
      IllegalArgumentException - if rateUnit is null
    • ChargingScheduleInfo

      public ChargingScheduleInfo(Duration duration, Instant start, UnitOfMeasure rateUnit, BigDecimal minRate)
      Constructor.
      Parameters:
      duration - the schedule duration
      start - the schedule start time
      rateUnit - the rate unit
      minRate - the minimum charge rate
      Throws:
      IllegalArgumentException - if rateUnit is null
    • ChargingScheduleInfo

      public ChargingScheduleInfo(ChargingScheduleInfo other)
      Copy constructor.
      Parameters:
      other - the info to copy
  • Method Details

    • isSameAs

      public boolean isSameAs(ChargingScheduleInfo other)
      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

      public boolean differsFrom(ChargingScheduleInfo other)
      Specified by:
      differsFrom in interface net.solarnetwork.domain.Differentiable<ChargingScheduleInfo>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDuration

      public Duration getDuration()
      Get the duration.
      Returns:
      the duration
    • setDuration

      public void setDuration(Duration duration)
      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 seconds is less than 1 then a null Duration will be set.

      Parameters:
      seconds - the duration
    • getStart

      public Instant getStart()
      Get the start time.
      Returns:
      the start
    • setStart

      public void setStart(Instant start)
      Set the start time.
      Parameters:
      start - the start to set
    • getStartValue

      public String getStartValue()
      Get the start date as a formatted instant.
      Returns:
      the date, as an ISO 8601 formatted string
    • setStartValue

      public void setStartValue(String value)
      Set the start date as an ISO 8601 formatted timestamp.
      Parameters:
      value - the date string
    • getRateUnit

      public UnitOfMeasure getRateUnit()
      Get the charging rate unit to use for the configured getPeriods().
      Returns:
      the unit, never null
    • setRateUnit

      public void setRateUnit(UnitOfMeasure rateUnit)
      Set the charging rate unit to use for the configured getPeriods().
      Parameters:
      rateUnit - the unit to set
      Throws:
      IllegalArgumentException - if rateUnit is 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

      public BigDecimal getMinRate()
      Returns:
      the minRate
    • setMinRate

      public void setMinRate(BigDecimal minRate)
      Parameters:
      minRate - the minRate to set
    • addPeriod

      public void addPeriod(ChargingSchedulePeriodInfo period)
      Add a period.
      Parameters:
      period - the period to add
    • getPeriods

      public List<ChargingSchedulePeriodInfo> getPeriods()
      Get the periods list.
      Returns:
      the periods
    • setPeriods

      public void setPeriods(List<ChargingSchedulePeriodInfo> periods)
      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