Homeautomation/src/main/java/de/ph87/homeautomation/channel/ChannelDto.java

32 lines
644 B
Java

package de.ph87.homeautomation.channel;
import lombok.Getter;
import lombok.ToString;
import java.io.Serializable;
import java.time.ZonedDateTime;
@Getter
@ToString
public abstract class ChannelDto implements Serializable {
private final long id;
private final String title;
private final String type;
private final Double value;
private final ZonedDateTime timestamp;
protected ChannelDto(final Channel channel) {
this.id = channel.getId();
this.title = channel.getName();
this.type = channel.getClass().getSimpleName();
this.value = channel.getValue();
this.timestamp = channel.getTimestamp();
}
}