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.

GroupChatUser.java 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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.interfaces;
  23. import java.util.Comparator;
  24. import java.util.Optional;
  25. /**
  26. * Describes a {@link User} that is present on a {@link GroupChat}.
  27. */
  28. public interface GroupChatUser extends Displayable {
  29. /**
  30. * Retrieves the {@link User} object which this object corresponds
  31. * to.
  32. *
  33. * @return The User object which this object represents
  34. */
  35. User getUser();
  36. /**
  37. * Retrieves the {@link GroupChat} this {@link User} is on.
  38. *
  39. * @return The corresponding GroupChat object
  40. */
  41. GroupChat getGroupChat();
  42. /**
  43. * Returns the most important mode that the client holds in its prefix
  44. * form (e.g. @, +, etc)
  45. *
  46. * @return The most important mode the client holds, or an empty string
  47. */
  48. String getImportantMode();
  49. /**
  50. * Returns a list of all modes known to be held by the client, in their
  51. * textual form (e.g. o, v, etc)
  52. *
  53. * @return All modes the client holds, or an empty string
  54. */
  55. String getAllModes();
  56. /**
  57. * Retrieves the nickname or display name used by this client.
  58. *
  59. * @return This client's nickname
  60. */
  61. String getNickname();
  62. /**
  63. * Retrieves the nickname or display name used by this client, with their most important mode
  64. * prefixed.
  65. *
  66. * @return This client's nickname with their important mode prefixed (if any).
  67. */
  68. String getModePrefixedNickname();
  69. /**
  70. * Retrieves the username or ident used by this client.
  71. *
  72. * @return This client's username
  73. */
  74. Optional<String> getUsername();
  75. /**
  76. * Retrieves the hostname that this client is connecting from.
  77. *
  78. * @return This client's hostname
  79. */
  80. Optional<String> getHostname();
  81. /**
  82. * Retrieves the full/real name of the client.
  83. *
  84. * @return This client's real name
  85. */
  86. Optional<String> getRealname();
  87. /**
  88. * Retrieves a comparator that can compare the important modes of a client.
  89. *
  90. * @return Mode comparator
  91. */
  92. Comparator<String> getModeComparator();
  93. }