Class SampledValue

java.lang.Object
net.solarnetwork.ocpp.domain.SampledValue
All Implemented Interfaces:
Comparable<SampledValue>

public class SampledValue extends Object implements Comparable<SampledValue>
A sampled value, e.g. a meter reading.
Version:
1.1
Author:
matt
  • Constructor Details

    • SampledValue

      public SampledValue(UUID sessionId, Instant timestamp, String value, ReadingContext context, Measurand measurand, Phase phase, Location location, UnitOfMeasure unit)
      Constructor.
      Parameters:
      sessionId - the session ID
      timestamp - the timestamp
      value - the value
      context - the context
      measurand - the measurand
      phase - the phase
      location - the location
      unit - the unit
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(SampledValue o)
      Specified by:
      compareTo in interface Comparable<SampledValue>
    • toString

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

      public UUID getSessionId()
      Get the ChargeSession ID associated with this value.
      Returns:
      the session ID
    • getTimestamp

      public Instant getTimestamp()
      Get the time the sample was captured.
      Returns:
      the timestamp
    • getValue

      public String getValue()
      Get the sampled value.
      Returns:
      the value the value
    • getContext

      public ReadingContext getContext()
      Get the reading context.
      Returns:
      the context
    • getMeasurand

      public Measurand getMeasurand()
      Get the measurement type.
      Returns:
      the measurand
    • getPhase

      public Phase getPhase()
      Get the phase.
      Returns:
      the phase
    • getLocation

      public Location getLocation()
      Get the location.
      Returns:
      the location
    • getUnit

      public UnitOfMeasure getUnit()
      Get the measurement unit.
      Returns:
      the unit
    • builder

      public static SampledValue.Builder builder()
      Creates builder to build SampledValue.
      Returns:
      created builder
    • toBuilder

      public SampledValue.Builder toBuilder()
      Get a builder, populated with this instance's values.
      Returns:
      a pre-populated builder