45 lines
1.0 KiB
Java
45 lines
1.0 KiB
Java
package de.ph87.home.knx.property;
|
|
|
|
import de.ph87.home.knx.GroupAddressJpaConverter;
|
|
import jakarta.annotation.Nullable;
|
|
import jakarta.persistence.Column;
|
|
import jakarta.persistence.Convert;
|
|
import jakarta.persistence.Entity;
|
|
import jakarta.persistence.Id;
|
|
import lombok.Getter;
|
|
import lombok.NoArgsConstructor;
|
|
import lombok.NonNull;
|
|
import lombok.ToString;
|
|
import tuwien.auto.calimero.GroupAddress;
|
|
|
|
@Entity
|
|
@Getter
|
|
@ToString
|
|
@NoArgsConstructor
|
|
public class KnxProperty {
|
|
|
|
@Id
|
|
@NonNull
|
|
private String id;
|
|
|
|
@Nullable
|
|
@Convert(converter = GroupAddressJpaConverter.class)
|
|
private GroupAddress read;
|
|
|
|
@Nullable
|
|
@Convert(converter = GroupAddressJpaConverter.class)
|
|
private GroupAddress write;
|
|
|
|
@NonNull
|
|
@Column(nullable = false)
|
|
private KnxPropertyType type;
|
|
|
|
public KnxProperty(@NonNull final String id, @NonNull final KnxPropertyType type, @Nullable final GroupAddress read, @Nullable final GroupAddress write) {
|
|
this.id = id;
|
|
this.type = type;
|
|
this.read = read;
|
|
this.write = write;
|
|
}
|
|
|
|
}
|