You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DebugModule.java 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * Copyright (c) 2006-2015 DMDirc Developers
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. * SOFTWARE.
  21. */
  22. package com.dmdirc.addons.debug;
  23. import com.dmdirc.ClientModule;
  24. import com.dmdirc.addons.debug.commands.Benchmark;
  25. import com.dmdirc.addons.debug.commands.ColourSpam;
  26. import com.dmdirc.addons.debug.commands.ConfigInfo;
  27. import com.dmdirc.addons.debug.commands.EventBusViewer;
  28. import com.dmdirc.addons.debug.commands.FakeError;
  29. import com.dmdirc.addons.debug.commands.FakeUpdates;
  30. import com.dmdirc.addons.debug.commands.FirstRun;
  31. import com.dmdirc.addons.debug.commands.ForceUpdate;
  32. import com.dmdirc.addons.debug.commands.GlobalConfigInfo;
  33. import com.dmdirc.addons.debug.commands.Identities;
  34. import com.dmdirc.addons.debug.commands.MemInfo;
  35. import com.dmdirc.addons.debug.commands.Notify;
  36. import com.dmdirc.addons.debug.commands.RunGC;
  37. import com.dmdirc.addons.debug.commands.ServerInfo;
  38. import com.dmdirc.addons.debug.commands.ServerState;
  39. import com.dmdirc.addons.debug.commands.Services;
  40. import com.dmdirc.addons.debug.commands.ShowRaw;
  41. import com.dmdirc.addons.debug.commands.StatusbarMessage;
  42. import com.dmdirc.addons.debug.commands.Threads;
  43. import com.dmdirc.addons.debug.commands.Time;
  44. import dagger.Module;
  45. import dagger.Provides;
  46. /**
  47. * Dependency injection module for the debug plugin.
  48. */
  49. @Module(injects = Debug.class, addsTo = ClientModule.class)
  50. public class DebugModule {
  51. @Provides(type = Provides.Type.SET)
  52. public DebugCommand getCommand(final Benchmark command) {
  53. return command;
  54. }
  55. @Provides(type = Provides.Type.SET)
  56. public DebugCommand getCommand(final ColourSpam command) {
  57. return command;
  58. }
  59. @Provides(type = Provides.Type.SET)
  60. public DebugCommand getCommand(final ConfigInfo command) {
  61. return command;
  62. }
  63. @Provides(type = Provides.Type.SET)
  64. public DebugCommand getCommand(final FakeError command) {
  65. return command;
  66. }
  67. @Provides(type = Provides.Type.SET)
  68. public DebugCommand getCommand(final FakeUpdates command) {
  69. return command;
  70. }
  71. @Provides(type = Provides.Type.SET)
  72. public DebugCommand getCommand(final FirstRun command) {
  73. return command;
  74. }
  75. @Provides(type = Provides.Type.SET)
  76. public DebugCommand getCommand(final ForceUpdate command) {
  77. return command;
  78. }
  79. @Provides(type = Provides.Type.SET)
  80. public DebugCommand getCommand(final GlobalConfigInfo command) {
  81. return command;
  82. }
  83. @Provides(type = Provides.Type.SET)
  84. public DebugCommand getCommand(final Identities command) {
  85. return command;
  86. }
  87. @Provides(type = Provides.Type.SET)
  88. public DebugCommand getCommand(final MemInfo command) {
  89. return command;
  90. }
  91. @Provides(type = Provides.Type.SET)
  92. public DebugCommand getCommand(final Notify command) {
  93. return command;
  94. }
  95. @Provides(type = Provides.Type.SET)
  96. public DebugCommand getCommand(final RunGC command) {
  97. return command;
  98. }
  99. @Provides(type = Provides.Type.SET)
  100. public DebugCommand getCommand(final ServerInfo command) {
  101. return command;
  102. }
  103. @Provides(type = Provides.Type.SET)
  104. public DebugCommand getCommand(final ServerState command) {
  105. return command;
  106. }
  107. @Provides(type = Provides.Type.SET)
  108. public DebugCommand getCommand(final Services command) {
  109. return command;
  110. }
  111. @Provides(type = Provides.Type.SET)
  112. public DebugCommand getCommand(final ShowRaw command) {
  113. return command;
  114. }
  115. @Provides(type = Provides.Type.SET)
  116. public DebugCommand getCommand(final StatusbarMessage command) {
  117. return command;
  118. }
  119. @Provides(type = Provides.Type.SET)
  120. public DebugCommand getCommand(final Threads command) {
  121. return command;
  122. }
  123. @Provides(type = Provides.Type.SET)
  124. public DebugCommand getCommand(final Time command) {
  125. return command;
  126. }
  127. @Provides(type = Provides.Type.SET)
  128. public DebugCommand getCommand(final EventBusViewer command) {
  129. return command;
  130. }
  131. }