1 package org.simantics.document.server.bean;
3 import org.simantics.document.server.io.CommandContext;
4 import org.simantics.document.server.io.ICommand;
6 public class Command implements ICommand {
8 public String targetId;
10 public String command;
11 public CommandContext constants;
15 public Command(String command) {
16 this.command = command;
19 public Command(String targetId, String trigger, String command, CommandContext constants) {
20 this.targetId = targetId;
21 this.trigger = trigger;
22 this.command = command;
23 this.constants = constants;
26 public String getTrigger() {
30 public String getTargetId() {
34 public String getCommand() {
39 public CommandContext getConstants() {
44 public String toString() {
45 StringBuilder sb = new StringBuilder();
59 public int hashCode() {
62 result = prime * result + ((command == null) ? 0 : command.hashCode());
63 result = prime * result
64 + ((constants == null) ? 0 : constants.hashCode());
65 result = prime * result
66 + ((targetId == null) ? 0 : targetId.hashCode());
67 result = prime * result + ((trigger == null) ? 0 : trigger.hashCode());
72 public boolean equals(Object obj) {
77 if (getClass() != obj.getClass())
79 Command other = (Command) obj;
80 if (command == null) {
81 if (other.command != null)
83 } else if (!command.equals(other.command))
85 if (constants == null) {
86 if (other.constants != null)
88 } else if (!constants.equals(other.constants))
90 if (targetId == null) {
91 if (other.targetId != null)
93 } else if (!targetId.equals(other.targetId))
95 if (trigger == null) {
96 if (other.trigger != null)
98 } else if (!trigger.equals(other.trigger))