Subversion Repositories HomeAutomation

Rev

Details | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
915 migan 1
package items;
2
 
3
public class Command
4
{
5
    private int id;
6
    private String name;
7
    private CommandType type;
8
    private String description;
9
    private String module;
10
 
11
    public Command() {}
12
 
13
    public Command(int id, String name, CommandType type, String description, String module)
14
    {
15
        this.id = id;
16
        this.name = name;
17
        this.type = type;
18
        this.description = description;
19
        this.module = module;
20
    }
21
 
22
    public int getId()
23
    {
24
        return id;
25
    }
26
 
27
    public void setId(int id)
28
    {
29
        this.id = id;
30
    }
31
 
32
    public String getName()
33
    {
34
        return name;
35
    }
36
 
37
    public void setName(String name)
38
    {
39
        this.name = name;
40
    }
41
 
42
    public CommandType getType()
43
    {
44
        return type;
45
    }
46
 
47
    public void setType(CommandType type)
48
    {
49
        this.type = type;
50
    }
51
 
52
    public String getDescription()
53
    {
54
        return description;
55
    }
56
 
57
    public void setDescription(String description)
58
    {
59
        this.description = description;
60
    }
61
 
62
    public String getModule()
63
    {
64
        return module;
65
    }
66
 
67
    public void setModule(String module)
68
    {
69
        this.module = module;
70
    }
71
 
72
    public String getCDefineName()
73
    {
74
        return "CAN_CMD_MODULE_" + this.type.getCPrefix() + "_" + this.name.toUpperCase();
75
    }
76
 
77
    public String toString()
78
    {
79
        String buffer = "";
80
        buffer += this.getName() + " (" + this.getId() + ")\n";
81
        buffer += "C define name: " + this.getCDefineName() + "\n";
82
        buffer += "Type: " + this.getType().getName() + "\n";
83
        buffer += "Description: " + this.getDescription() + "\n";
84
        return buffer;
85
    }
86
}