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

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