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 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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.Services;
  39. import com.dmdirc.addons.debug.commands.ShowRaw;
  40. import com.dmdirc.addons.debug.commands.StatusbarMessage;
  41. import com.dmdirc.addons.debug.commands.Threads;
  42. import com.dmdirc.addons.debug.commands.Time;
  43. import dagger.Module;
  44. import dagger.Provides;
  45. /**
  46. * Dependency injection module for the debug plugin.
  47. */
  48. @Module(injects = Debug.class, addsTo = ClientModule.class)
  49. public class DebugModule {
  50. @Provides(type = Provides.Type.SET)
  51. public DebugCommand getCommand(final Benchmark command) {
  52. return command;
  53. }
  54. @Provides(type = Provides.Type.SET)
  55. public DebugCommand getCommand(final ColourSpam command) {
  56. return command;
  57. }
  58. @Provides(type = Provides.Type.SET)
  59. public DebugCommand getCommand(final ConfigInfo command) {
  60. return command;
  61. }
  62. @Provides(type = Provides.Type.SET)
  63. public DebugCommand getCommand(final FakeError command) {
  64. return command;
  65. }
  66. @Provides(type = Provides.Type.SET)
  67. public DebugCommand getCommand(final FakeUpdates command) {
  68. return command;
  69. }
  70. @Provides(type = Provides.Type.SET)
  71. public DebugCommand getCommand(final FirstRun command) {
  72. return command;
  73. }
  74. @Provides(type = Provides.Type.SET)
  75. public DebugCommand getCommand(final ForceUpdate command) {
  76. return command;
  77. }
  78. @Provides(type = Provides.Type.SET)
  79. public DebugCommand getCommand(final GlobalConfigInfo command) {
  80. return command;
  81. }
  82. @Provides(type = Provides.Type.SET)
  83. public DebugCommand getCommand(final Identities command) {
  84. return command;
  85. }
  86. @Provides(type = Provides.Type.SET)
  87. public DebugCommand getCommand(final MemInfo command) {
  88. return command;
  89. }
  90. @Provides(type = Provides.Type.SET)
  91. public DebugCommand getCommand(final Notify command) {
  92. return command;
  93. }
  94. @Provides(type = Provides.Type.SET)
  95. public DebugCommand getCommand(final RunGC command) {
  96. return command;
  97. }
  98. @Provides(type = Provides.Type.SET)
  99. public DebugCommand getCommand(final ServerInfo command) {
  100. return command;
  101. }
  102. @Provides(type = Provides.Type.SET)
  103. public DebugCommand getCommand(final Services command) {
  104. return command;
  105. }
  106. @Provides(type = Provides.Type.SET)
  107. public DebugCommand getCommand(final ShowRaw command) {
  108. return command;
  109. }
  110. @Provides(type = Provides.Type.SET)
  111. public DebugCommand getCommand(final StatusbarMessage command) {
  112. return command;
  113. }
  114. @Provides(type = Provides.Type.SET)
  115. public DebugCommand getCommand(final Threads command) {
  116. return command;
  117. }
  118. @Provides(type = Provides.Type.SET)
  119. public DebugCommand getCommand(final Time command) {
  120. return command;
  121. }
  122. @Provides(type = Provides.Type.SET)
  123. public DebugCommand getCommand(final EventBusViewer command) {
  124. return command;
  125. }
  126. }