00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 package com.realtime.crossfire.jxclient.commands;
00023
00024 import org.jetbrains.annotations.NotNull;
00025 import org.jetbrains.annotations.Nullable;
00026
00031 public class CommandExec {
00032
00036 @Nullable
00037 private final Command command;
00038
00042 @NotNull
00043 private final String args;
00044
00051 public CommandExec(@Nullable final Command command, @NotNull final String args) {
00052 this.command = command;
00053 this.args = args;
00054 }
00055
00061 @Nullable
00062 public Command getCommand() {
00063 return command;
00064 }
00065
00070 @NotNull
00071 public String getArgs() {
00072 return args;
00073 }
00074
00078 @Override
00079 public int hashCode() {
00080 return (command == null ? 0 : command.hashCode())+args.hashCode();
00081 }
00082
00086 @Override
00087 public boolean equals(@Nullable final Object obj) {
00088 if (obj == null || obj.getClass() != getClass()) {
00089 return false;
00090 }
00091 final CommandExec o = (CommandExec)obj;
00092 return command == o.command && args.equals(o.args);
00093 }
00094
00098 @NotNull
00099 @Override
00100 public String toString() {
00101 return command+"/"+args;
00102 }
00103
00104 }