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

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

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

Message.determineLanguage介绍

暂无

代码示例

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

/**
 * Removes the subject with the given language from the message.
 *
 * @param language the language of the subject which is to be removed
 * @return true if a subject was removed and false if it was not.
 */
public boolean removeSubject(String language) {
  language = determineLanguage(language);
  for (Subject subject : subjects) {
    if (language.equals(subject.language)) {
      return subjects.remove(subject);
    }
  }
  return false;
}

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

private Subject getMessageSubject(String language) {
  language = determineLanguage(language);
  for (Subject subject : subjects) {
    if (Objects.equals(language, subject.language)) {
      return subject;
    }
  }
  return null;
}

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

/**
 * Adds a subject with a corresponding language.
 *
 * @param language the language of the subject being added.
 * @param subject the subject being added to the message.
 * @return the new {@link org.jivesoftware.smack.packet.Message.Subject}
 * @throws NullPointerException if the subject is null, a null pointer exception is thrown
 */
public Subject addSubject(String language, String subject) {
  language = determineLanguage(language);
  Subject messageSubject = new Subject(language, subject);
  subjects.add(messageSubject);
  return messageSubject;
}

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

private Body getMessageBody(String language) {
  language = determineLanguage(language);
  for (Body body : getBodies()) {
    if (Objects.equals(language, body.language) || (language != null && language.equals(this.language) && body.language == null)) {
      return body;
    }
  }
  return null;
}

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

/**
 * Adds a body with a corresponding language.
 *
 * @param language the language of the body being added.
 * @param body the body being added to the message.
 * @return the new {@link org.jivesoftware.smack.packet.Message.Body}
 * @throws NullPointerException if the body is null, a null pointer exception is thrown
 * @since 3.0.2
 */
public Body addBody(String language, String body) {
  language = determineLanguage(language);
  removeBody(language);
  Body messageBody = new Body(language, body);
  addExtension(messageBody);
  return messageBody;
}

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

/**
 * Removes the body with the given language from the message.
 *
 * @param language the language of the body which is to be removed
 * @return true if a body was removed and false if it was not.
 */
public boolean removeBody(String language) {
  language = determineLanguage(language);
  for (Body body : getBodies()) {
    String bodyLanguage = body.getLanguage();
    if (Objects.equals(bodyLanguage, language)) {
      removeExtension(body);
      return true;
    }
  }
  return false;
}

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

private Body getMessageBody(String language) {
  language = determineLanguage(language);
  for (Body body : bodies) {
    if (language.equals(body.language)) {
      return body;
    }
  }
  return null;
}

代码示例来源:origin: org.littleshoot/smack-xmpp-3-2-2

private Subject getMessageSubject(String language) {
  language = determineLanguage(language);
  for (Subject subject : subjects) {
    if (language.equals(subject.language)) {
      return subject;
    }
  }
  return null;
}

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

private Subject getMessageSubject(String language) {
  language = determineLanguage(language);
  for (Subject subject : subjects) {
    if (language.equals(subject.language)) {
      return subject;
    }
  }
  return null;
}

代码示例来源:origin: tiandawu/IotXmpp

private Body getMessageBody(String language) {
  language = determineLanguage(language);
  for (Body body : bodies) {
    if (language.equals(body.language)) {
      return body;
    }
  }
  return null;
}

代码示例来源:origin: org.littleshoot/smack-xmpp-3-2-2

private Body getMessageBody(String language) {
  language = determineLanguage(language);
  for (Body body : bodies) {
    if (language.equals(body.language)) {
      return body;
    }
  }
  return null;
}

代码示例来源:origin: tiandawu/IotXmpp

private Subject getMessageSubject(String language) {
  language = determineLanguage(language);
  for (Subject subject : subjects) {
    if (language.equals(subject.language)) {
      return subject;
    }
  }
  return null;
}

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

/**
 * Removes the subject with the given language from the message.
 *
 * @param language the language of the subject which is to be removed
 * @return true if a subject was removed and false if it was not.
 */
public boolean removeSubject(String language) {
  language = determineLanguage(language);
  for (Subject subject : subjects) {
    if (language.equals(subject.language)) {
      return subjects.remove(subject);
    }
  }
  return false;
}

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

private Subject getMessageSubject(String language) {
  language = determineLanguage(language);
  for (Subject subject : subjects) {
    if (Objects.equals(language, subject.language)) {
      return subject;
    }
  }
  return null;
}

代码示例来源:origin: tiandawu/IotXmpp

/**
 * Adds a body with a corresponding language.
 *
 * @param language the language of the body being added.
 * @param body     the body being added to the message.
 * @return the new {@link Body}
 * @throws NullPointerException if the body is null, a null pointer exception is thrown
 * @since 3.0.2
 */
public Body addBody(String language, String body) {
  language = determineLanguage(language);
  Body messageBody = new Body(language, body);
  bodies.add(messageBody);
  return messageBody;
}

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

/**
 * Adds a subject with a corresponding language.
 *
 * @param language the language of the subject being added.
 * @param subject the subject being added to the message.
 * @return the new {@link org.jivesoftware.smack.packet.Message.Subject}
 * @throws NullPointerException if the subject is null, a null pointer exception is thrown
 */
public Subject addSubject(String language, String subject) {
  language = determineLanguage(language);
  Subject messageSubject = new Subject(language, subject);
  subjects.add(messageSubject);
  return messageSubject;
}

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

/**
 * Adds a subject with a corresponding language.
 *
 * @param language the language of the subject being added.
 * @param subject the subject being added to the message.
 * @return the new {@link org.jivesoftware.smack.packet.Message.Subject}
 * @throws NullPointerException if the subject is null, a null pointer exception is thrown
 */
public Subject addSubject(String language, String subject) {
  language = determineLanguage(language);
  Subject messageSubject = new Subject(language, subject);
  subjects.add(messageSubject);
  return messageSubject;
}

代码示例来源:origin: tiandawu/IotXmpp

/**
 * Adds a subject with a corresponding language.
 *
 * @param language the language of the subject being added.
 * @param subject  the subject being added to the message.
 * @return the new {@link Subject}
 * @throws NullPointerException if the subject is null, a null pointer exception is thrown
 */
public Subject addSubject(String language, String subject) {
  language = determineLanguage(language);
  Subject messageSubject = new Subject(language, subject);
  subjects.add(messageSubject);
  return messageSubject;
}

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

/**
 * Adds a body with a corresponding language.
 *
 * @param language the language of the body being added.
 * @param body the body being added to the message.
 * @return the new {@link org.jivesoftware.smack.packet.Message.Body}
 * @throws NullPointerException if the body is null, a null pointer exception is thrown
 * @since 3.0.2
 */
public Body addBody(String language, String body) {
  language = determineLanguage(language);
  Body messageBody = new Body(language, body);
  bodies.add(messageBody);
  return messageBody;
}

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

private Body getMessageBody(String language) {
  language = determineLanguage(language);
  for (Body body : getBodies()) {
    if (Objects.equals(language, body.language) || (language != null && language.equals(this.language) && body.language == null)) {
      return body;
    }
  }
  return null;
}

相关文章