org.jivesoftware.smack.packet.Message.removeExtension()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.jivesoftware.smack.packet.Message.removeExtension()方法的一些代码示例,展示了Message.removeExtension()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.removeExtension()方法的具体详情如下:
包路径:org.jivesoftware.smack.packet.Message
类名称:Message
方法名:removeExtension

Message.removeExtension介绍

暂无

代码示例

代码示例来源:origin: igniterealtime/Smack

  1. /**
  2. * Removes the body from the message and returns true if the body was removed.
  3. *
  4. * @param body the body being removed from the message.
  5. * @return true if the body was successfully removed and false if it was not.
  6. * @since 3.0.2
  7. */
  8. public boolean removeBody(Body body) {
  9. ExtensionElement removedElement = removeExtension(body);
  10. return removedElement != null;
  11. }

代码示例来源:origin: igniterealtime/Smack

  1. /**
  2. * Removes the body with the given language from the message.
  3. *
  4. * @param language the language of the body which is to be removed
  5. * @return true if a body was removed and false if it was not.
  6. */
  7. public boolean removeBody(String language) {
  8. language = determineLanguage(language);
  9. for (Body body : getBodies()) {
  10. String bodyLanguage = body.getLanguage();
  11. if (Objects.equals(bodyLanguage, language)) {
  12. removeExtension(body);
  13. return true;
  14. }
  15. }
  16. return false;
  17. }

代码示例来源:origin: org.igniterealtime.smack/smack-core

  1. /**
  2. * Removes the body from the message and returns true if the body was removed.
  3. *
  4. * @param body the body being removed from the message.
  5. * @return true if the body was successfully removed and false if it was not.
  6. * @since 3.0.2
  7. */
  8. public boolean removeBody(Body body) {
  9. ExtensionElement removedElement = removeExtension(body);
  10. return removedElement != null;
  11. }

代码示例来源:origin: org.igniterealtime.smack/smack-core

  1. /**
  2. * Removes the body with the given language from the message.
  3. *
  4. * @param language the language of the body which is to be removed
  5. * @return true if a body was removed and false if it was not.
  6. */
  7. public boolean removeBody(String language) {
  8. language = determineLanguage(language);
  9. for (Body body : getBodies()) {
  10. String bodyLanguage = body.getLanguage();
  11. if (Objects.equals(bodyLanguage, language)) {
  12. removeExtension(body);
  13. return true;
  14. }
  15. }
  16. return false;
  17. }

相关文章