Selaa lähdekoodia

Remove more lombok

Change-Id: If55bbd800025128ae8efd06aeeae32fd377d3979
Reviewed-on: http://gerrit.dmdirc.com/2985
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.8rc1
Greg Holmes 10 vuotta sitten
vanhempi
commit
e20eb24353

+ 1
- 1
src/com/dmdirc/Server.java Näytä tiedosto

@@ -97,7 +97,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
97 97
 @Factory(inject = true, singleton = true, providers = true, name = "ServerFactoryImpl")
98 98
 public class Server extends WritableFrameContainer implements ConfigChangeListener,
99 99
         CertificateProblemListener, Connection {
100
-    
100
+
101 101
     private static final org.slf4j.Logger log = LoggerFactory.getLogger(Server.class);
102 102
 
103 103
     /** The name of the general domain. */

+ 18
- 6
src/com/dmdirc/commandparser/BaseCommandInfo.java Näytä tiedosto

@@ -22,16 +22,10 @@
22 22
 
23 23
 package com.dmdirc.commandparser;
24 24
 
25
-import lombok.Getter;
26
-import lombok.RequiredArgsConstructor;
27
-
28 25
 /**
29 26
  * A basic {@link CommandInfo} implementation whose parameters can be
30 27
  * configured via the constructor.
31 28
  */
32
-@Getter
33
-@RequiredArgsConstructor
34
-@SuppressWarnings("PMD.UnusedPrivateField")
35 29
 public class BaseCommandInfo implements CommandInfo {
36 30
 
37 31
     /** The name of the command. */
@@ -43,4 +37,22 @@ public class BaseCommandInfo implements CommandInfo {
43 37
     /** The type of the command. */
44 38
     private final CommandType type;
45 39
 
40
+    public BaseCommandInfo(final String name, final String help, final CommandType type) {
41
+        this.name = name;
42
+        this.help = help;
43
+        this.type = type;
44
+    }
45
+
46
+    public String getName() {
47
+        return name;
48
+    }
49
+
50
+    public String getHelp() {
51
+        return help;
52
+    }
53
+
54
+    public CommandType getType() {
55
+        return type;
56
+    }
57
+
46 58
 }

+ 13
- 6
src/com/dmdirc/commandparser/CommandInfoPair.java Näytä tiedosto

@@ -24,18 +24,12 @@ package com.dmdirc.commandparser;
24 24
 
25 25
 import com.dmdirc.commandparser.commands.Command;
26 26
 
27
-import lombok.Getter;
28
-import lombok.RequiredArgsConstructor;
29
-
30 27
 /**
31 28
  * A combination of a {@link Command} and the {@link CommandInfo} which
32 29
  * triggered it.
33 30
  *
34 31
  * @since 0.6.4
35 32
  */
36
-@RequiredArgsConstructor
37
-@Getter
38
-@SuppressWarnings("PMD.UnusedPrivateField")
39 33
 public class CommandInfoPair {
40 34
 
41 35
     /** The command info which caused the command to be triggered. */
@@ -44,4 +38,17 @@ public class CommandInfoPair {
44 38
     /** The command in question. */
45 39
     private final Command command;
46 40
 
41
+    public CommandInfoPair(final CommandInfo commandInfo, final Command command) {
42
+        this.commandInfo = commandInfo;
43
+        this.command = command;
44
+    }
45
+
46
+    public CommandInfo getCommandInfo() {
47
+        return commandInfo;
48
+    }
49
+
50
+    public Command getCommand() {
51
+        return command;
52
+    }
53
+
47 54
 }

+ 8
- 5
src/com/dmdirc/commandparser/CommandManager.java Näytä tiedosto

@@ -39,13 +39,10 @@ import java.util.HashMap;
39 39
 import java.util.List;
40 40
 import java.util.Map;
41 41
 
42
-import lombok.Getter;
43
-
44 42
 /**
45 43
  * The command manager creates and manages a single instance of all commands,
46 44
  * and provides methods to load each group of commands into a parser instance.
47 45
  */
48
-@SuppressWarnings("PMD.UnusedPrivateField")
49 46
 public class CommandManager implements CommandController {
50 47
 
51 48
     /** A list of commands that have been instantiated. */
@@ -61,12 +58,10 @@ public class CommandManager implements CommandController {
61 58
 
62 59
     /** The command char we're using. */
63 60
     @ConfigBinding(domain="general", key="commandchar")
64
-    @Getter
65 61
     private char commandChar;
66 62
 
67 63
     /** The silence char we're using. */
68 64
     @ConfigBinding(domain="general", key="silencechar")
69
-    @Getter
70 65
     private char silenceChar;
71 66
 
72 67
     /**
@@ -78,6 +73,14 @@ public class CommandManager implements CommandController {
78 73
         this.serverManager = serverManager;
79 74
     }
80 75
 
76
+    public char getCommandChar() {
77
+        return commandChar;
78
+    }
79
+
80
+    public char getSilenceChar() {
81
+        return silenceChar;
82
+    }
83
+
81 84
     /**
82 85
      * Initialises the command manager.
83 86
      *

+ 8
- 6
src/com/dmdirc/commandparser/commands/Command.java Näytä tiedosto

@@ -28,14 +28,9 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
28 28
 import com.dmdirc.interfaces.CommandController;
29 29
 import com.dmdirc.ui.messages.Styliser;
30 30
 
31
-import lombok.AccessLevel;
32
-import lombok.Getter;
33
-import lombok.RequiredArgsConstructor;
34
-
35 31
 /**
36 32
  * Represents a generic command.
37 33
  */
38
-@RequiredArgsConstructor
39 34
 public abstract class Command {
40 35
 
41 36
     /** The format name used for command output. */
@@ -45,9 +40,16 @@ public abstract class Command {
45 40
     protected static final String FORMAT_ERROR = "commandError";
46 41
 
47 42
     /** The controller this command is associated with. */
48
-    @Getter(AccessLevel.PROTECTED)
49 43
     private final CommandController controller;
50 44
 
45
+    public Command(final CommandController controller) {
46
+        this.controller = controller;
47
+    }
48
+
49
+    protected CommandController getController() {
50
+        return controller;
51
+    }
52
+
51 53
     /**
52 54
      * Sends a line, if appropriate, to the specified target.
53 55
      * @param target The command window to send the line to

+ 13
- 5
src/com/dmdirc/commandparser/commands/CommandModule.java Näytä tiedosto

@@ -72,9 +72,6 @@ import com.dmdirc.interfaces.CommandController.CommandDetails;
72 72
 import java.util.HashSet;
73 73
 import java.util.Set;
74 74
 
75
-import lombok.Getter;
76
-import lombok.RequiredArgsConstructor;
77
-
78 75
 import dagger.Module;
79 76
 import dagger.Provides;
80 77
 
@@ -565,10 +562,21 @@ public class CommandModule {
565 562
     /**
566 563
      * Simple implementation of {@link CommandDetails}.
567 564
      */
568
-    @Getter
569
-    @RequiredArgsConstructor
570 565
     private static class SimpleCommandDetails implements CommandDetails {
571 566
 
567
+        public SimpleCommandDetails(Command command, CommandInfo info) {
568
+            this.command = command;
569
+            this.info = info;
570
+        }
571
+
572
+        public Command getCommand() {
573
+            return command;
574
+        }
575
+
576
+        public CommandInfo getInfo() {
577
+            return info;
578
+        }
579
+
572 580
         /** The command. */
573 581
         private final Command command;
574 582
 

+ 19
- 5
src/com/dmdirc/commandparser/commands/IntelligentCommand.java Näytä tiedosto

@@ -27,9 +27,6 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
27 27
 
28 28
 import java.util.List;
29 29
 
30
-import lombok.Getter;
31
-import lombok.RequiredArgsConstructor;
32
-
33 30
 /**
34 31
  * Intelligent commands implement a method that provides a list of possible
35 32
  * options for them, for use (for example) by table completers.
@@ -52,11 +49,28 @@ public interface IntelligentCommand {
52 49
      *
53 50
      * @since 0.6.4
54 51
      */
55
-    @RequiredArgsConstructor
56
-    @Getter
57 52
     @SuppressWarnings("PMD.UnusedPrivateField")
58 53
     class IntelligentCommandContext {
59 54
 
55
+        public IntelligentCommandContext(final WritableFrameContainer window,
56
+                final List<String> previousArgs, final String partial) {
57
+            this.window = window;
58
+            this.previousArgs = previousArgs;
59
+            this.partial = partial;
60
+        }
61
+
62
+        public WritableFrameContainer getWindow() {
63
+            return window;
64
+        }
65
+
66
+        public List<String> getPreviousArgs() {
67
+            return previousArgs;
68
+        }
69
+
70
+        public String getPartial() {
71
+            return partial;
72
+        }
73
+
60 74
         /** The window the command is being entered in. */
61 75
         private final WritableFrameContainer window;
62 76
 

+ 33
- 8
src/com/dmdirc/commandparser/commands/PreviousCommand.java Näytä tiedosto

@@ -23,18 +23,11 @@
23 23
 package com.dmdirc.commandparser.commands;
24 24
 
25 25
 import java.util.Date;
26
-
27
-import lombok.EqualsAndHashCode;
28
-import lombok.Getter;
29
-import lombok.RequiredArgsConstructor;
26
+import java.util.Objects;
30 27
 
31 28
 /**
32 29
  * Stores information about a previously executed command.
33 30
  */
34
-@RequiredArgsConstructor
35
-@EqualsAndHashCode
36
-@Getter
37
-@SuppressWarnings("PMD.UnusedPrivateField")
38 31
 public final class PreviousCommand {
39 32
 
40 33
     /** The full command that was executed. */
@@ -43,4 +36,36 @@ public final class PreviousCommand {
43 36
     /** The timestamp of its execution. */
44 37
     private final long time = new Date().getTime();
45 38
 
39
+    public PreviousCommand(final String line) {
40
+        this.line = line;
41
+    }
42
+
43
+    public String getLine() {
44
+        return line;
45
+    }
46
+
47
+    public long getTime() {
48
+        return time;
49
+    }
50
+
51
+    @Override
52
+    public int hashCode() {
53
+        return (int) (time ^ (time >>> 32)) + (line == null ? 0 : line.hashCode());
54
+    }
55
+
56
+    @Override
57
+    public boolean equals(final Object obj) {
58
+        if (obj == null) {
59
+            return false;
60
+        }
61
+        if (getClass() != obj.getClass()) {
62
+            return false;
63
+        }
64
+        final PreviousCommand other = (PreviousCommand) obj;
65
+        if (!Objects.equals(this.line, other.line)) {
66
+            return false;
67
+        }
68
+        return this.time == other.time;
69
+    }
70
+
46 71
 }

Loading…
Peruuta
Tallenna