All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.lunasaw.gb28181.common.entity.control.DeviceControlPosition Maven / Gradle / Ivy

The newest version!
package io.github.lunasaw.gb28181.common.entity.control;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 *
 * 
 * 
 * DeviceControl
 * 840481
 * channelId
 * 
 * 1
 * resetTime
 * presetIndex
 * 
 * 
 * 
 * @author luna
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@XmlRootElement(name = "Control")
@XmlAccessorType(XmlAccessType.FIELD)
public class DeviceControlPosition extends DeviceControlBase {


    @XmlElement(name = "HomePosition")
    public HomePosition homePosition;

    public DeviceControlPosition(String cmdType, String sn, String deviceId) {
        super(cmdType, sn, deviceId);
        this.setControlType("HomePosition");
    }

    public static void main(String[] args) {
        DeviceControlPosition alarm = new DeviceControlPosition();
        alarm.setCmdType("DeviceControl");
        alarm.setSn("179173");
        alarm.setDeviceId("123");

        HomePosition homePosition = new HomePosition();
        homePosition.setEnabled("1");
        homePosition.setResetTime("222");
        homePosition.setPresetIndex("2");
        alarm.setHomePosition(homePosition);

        System.out.println(alarm);

    }

    @Getter
    @Setter
    @AllArgsConstructor
    @NoArgsConstructor
    @XmlRootElement(name = "HomePosition")
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class HomePosition {

        @XmlElement(name = "Enabled")
        public String enabled;

        @XmlElement(name = "ResetTime")
        public String resetTime;
        @XmlElement(name = "PresetIndex")
        private String presetIndex;

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy