package com.lmco.energyc2.seeload.participantsvc.ejb;

import javax.persistence.*;
import javax.xml.bind.annotation.*;
import java.io.Serializable;

@Entity
@Table(name = "LOAD_CONTROL_DEVICES")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "LoadControlDevice")
public class LoadControlDevice
    implements Serializable
{
  @Id
  @Column(name="UUID", nullable=false)
  @XmlAttribute(required = true)
  private String uuid;

  @ManyToOne
  @JoinColumn(name="USERID", referencedColumnName = "USERID")
  @XmlTransient
  private Participant participant;

  @Column(nullable=true)
  @XmlAttribute
  private String name;

  @Column(nullable=false)
  @XmlAttribute(required = true)
  private String manufacturer;

  @Column(nullable=false)
  @XmlAttribute(required = true)
  private String model;

  @Column(nullable=false)
  @XmlAttribute(required = true)
  private String ipAddress;

  @Column(nullable=false)
  @XmlAttribute(required = true)
  private boolean enabled;

  public LoadControlDevice()
  {
  }

  public LoadControlDevice(Participant participant)
  {
    this.participant = participant;
  }

  public Participant getParticipant()
  {
    return participant;
  }

  public String getUuid()
  {
    return uuid;
  }

  public void setUuid(String value)
  {
    this.uuid = value;
  }

  public boolean isSetUuid()
  {
    return (this.uuid != null);
  }

  public String getName()
  {
    return name;
  }

  public void setName(String value)
  {
    this.name = value;
  }

  public boolean isSetName()
  {
    return (this.name != null);
  }

  public String getManufacturer()
  {
    return manufacturer;
  }

  public void setManufacturer(String value)
  {
    this.manufacturer = value;
  }

  public boolean isSetManufacturer()
  {
    return (this.manufacturer != null);
  }

  public String getModel()
  {
    return model;
  }

  public void setModel(String value)
  {
    this.model = value;
  }

  public boolean isSetModel()
  {
    return (this.model != null);
  }

  public String getIpAddress()
  {
    return ipAddress;
  }

  public void setIpAddress(String value)
  {
    this.ipAddress = value;
  }

  public boolean isSetIpAddress()
  {
    return (this.ipAddress != null);
  }

  public boolean isEnabled()
  {
    return enabled;
  }

  public void setEnabled(boolean value)
  {
    this.enabled = value;
  }

  public boolean isSetEnabled()
  {
    return true;
  }
}