public Builder setAdminAccountUsernameAndPassword(String adminAccountUsername, String adminAccountPassword) { this.adminAccountUsername = StringUtils.requireNotNullNorEmpty(adminAccountUsername, "adminAccountUsername must not be null nor empty"); this.adminAccountPassword = StringUtils.requireNotNullNorEmpty(adminAccountPassword, "adminAccountPassword must no be null nor empty"); return this; }
protected JingleS5BTransport(List<JingleContentTransportCandidate> candidates, JingleContentTransportInfo info, String streamId, String dstAddr, Bytestream.Mode mode) { super(candidates, info); StringUtils.requireNotNullNorEmpty(streamId, "sid MUST be neither null, nor empty."); this.streamId = streamId; this.dstAddr = dstAddr; this.mode = mode; }
/** * Creates a new FormField with the variable name that uniquely identifies the field * in the context of the form. * * @param variable the variable name of the question. */ public FormField(String variable) { this.variable = StringUtils.requireNotNullNorEmpty(variable, "Variable must not be null nor empty"); }
public Builder setSessionId(String sessionId) { StringUtils.requireNotNullNorEmpty(sessionId, "Session ID must not be null nor empty"); this.sid = sessionId; return this; }
/** * Creates a new thread filter using the specified thread value. * * @param thread the thread value to filter for. */ public ThreadFilter(String thread) { StringUtils.requireNotNullNorEmpty(thread, "Thread must not be null nor empty."); this.thread = thread; }
/** * Creates a new stanza extension filter. Stanzas will pass the filter if * they have a stanza extension that matches the specified element name * and namespace. * * @param elementName the XML element name of the stanza extension. * @param namespace the XML namespace of the stanza extension. */ public StanzaExtensionFilter(String elementName, String namespace) { StringUtils.requireNotNullNorEmpty(namespace, "namespace must not be null nor empty"); this.elementName = elementName; this.namespace = namespace; }
/** * Sets the unique ID of the packet. To indicate that a stanza has no id * pass <code>null</code> as the packet's id value. * * @param id the unique ID for the packet. */ public void setStanzaId(String id) { if (id != null) { requireNotNullNorEmpty(id, "id must either be null or not the empty String"); } this.id = id; }
/** * Creates a new stanza ID filter using the specified stanza ID. * * @param stanzaId the stanza ID to filter for. */ public StanzaIdFilter(String stanzaId) { this.stanzaId = StringUtils.requireNotNullNorEmpty(stanzaId, "Stanza ID must not be null nor empty."); }
/** * BoB hash constructor. * * @param hash * @param hashType */ public BoBHash(String hash, String hashType) { this.hash = StringUtils.requireNotNullNorEmpty(hash, "hash must not be null nor empty"); this.hashType = StringUtils.requireNotNullNorEmpty(hashType, "hashType must not be null nor empty"); this.cid = this.hashType + '+' + this.hash + "@bob.xmpp.org"; }
/** * Creates a new feature offered by an XMPP entity or item. * * @param variable the feature's variable. */ public Feature(String variable) { this.variable = StringUtils.requireNotNullNorEmpty(variable, "variable cannot be null"); }
public Builder setUsernamesAndPassword(String accountOneUsername, String accountOnePassword, String accountTwoUsername, String accountTwoPassword, String accountThreeUsername, String accountThreePassword) { this.accountOneUsername = StringUtils.requireNotNullNorEmpty(accountOneUsername, "accountOneUsername must not be null nor empty"); this.accountOnePassword = StringUtils.requireNotNullNorEmpty(accountOnePassword, "accountOnePassword must not be null nor empty"); this.accountTwoUsername = StringUtils.requireNotNullNorEmpty(accountTwoUsername, "accountTwoUsername must not be null nor empty"); this.accountTwoPassword = StringUtils.requireNotNullNorEmpty(accountTwoPassword, "accountTwoPasswordmust not be null nor empty"); this.accountThreeUsername = StringUtils.requireNotNullNorEmpty(accountThreeUsername, "accountThreeUsername must not be null nor empty"); this.accountThreePassword = StringUtils.requireNotNullNorEmpty(accountThreePassword, "accountThreePassword must not be null nor empty"); return this; }
public ExplicitMessageEncryptionElement(String encryptionNamespace, String name) { this.encryptionNamespace = StringUtils.requireNotNullNorEmpty(encryptionNamespace, "encryptionNamespace must not be null"); this.name = name; }
public NodeInfo(String nodeId, String sourceId, String cacheType) { this.nodeId = StringUtils.requireNotNullNorEmpty(nodeId, "Node ID must not be null nor empty"); this.sourceId = sourceId; this.cacheType = cacheType; }
/** * Creates a new stanza ID filter using the specified stanza ID. * * @param packetID the stanza ID to filter for. * @deprecated use {@link StanzaIdFilter#StanzaIdFilter(Stanza)} instead. */ @Deprecated public PacketIDFilter(String packetID) { StringUtils.requireNotNullNorEmpty(packetID, "Packet ID must not be null nor empty."); this.packetID = packetID; }
public Tag(String name, Type type, String value) { // TODO According to XEP-0347 § 5.2 names are case insensitive. Uppercase them all? this.name = StringUtils.requireNotNullNorEmpty(name, "name must not be null nor empty"); this.type = Objects.requireNonNull(type); this.value = StringUtils.requireNotNullNorEmpty(value, "value must not be null nor empty"); if (this.name.length() > 32) { throw new IllegalArgumentException("Meta Tag names must not be longer then 32 characters (XEP-0347 § 5.2"); } if (this.type == Type.str && this.value.length() > 128) { throw new IllegalArgumentException("Meta Tag string values must not be longer then 128 characters (XEP-0347 § 5.2"); } }
public Builder addAttribute(String name, String value) { StringUtils.requireNotNullNorEmpty(name, "Attribute name must be set"); Objects.requireNonNull(value, "Attribute value must be not null"); if (attributes == null) { attributes = new LinkedHashMap<>(); } attributes.put(name, value); return this; }
/** * Creates a content description.. */ private JingleContent(Creator creator, String disposition, String name, Senders senders, JingleContentDescription description, JingleContentTransport transport) { this.creator = Objects.requireNonNull(creator, "Jingle content creator must not be null"); this.disposition = disposition; this.name = StringUtils.requireNotNullNorEmpty(name, "Jingle content name must not be null nor empty"); this.senders = senders; this.description = description; this.transport = transport; }
/** * Add the given mechanism to the enabled ones. See {@link #addEnabledSaslMechanism(Collection)} for a discussion about enabled SASL mechanisms. * * @param saslMechanism the name of the mechanism to enable. * @return a reference to this builder. */ public B addEnabledSaslMechanism(String saslMechanism) { return addEnabledSaslMechanism(Arrays.asList(StringUtils.requireNotNullNorEmpty(saslMechanism, "saslMechanism must not be null nor empty"))); }
public AuthMechanism(String mechanism, String authenticationText) { this.mechanism = Objects.requireNonNull(mechanism, "SASL mechanism shouldn't be null."); this.authenticationText = StringUtils.requireNotNullNorEmpty(authenticationText, "SASL authenticationText must not be null nor empty (RFC6120 6.4.2)"); }
/** * Default constructor. * * @param jid The JID of the stream host. * @param address The internet address of the stream host. * @param port port of the stream host. */ public StreamHost(final Jid jid, final String address, int port) { this.jid = Objects.requireNonNull(jid, "StreamHost JID must not be null"); this.address = StringUtils.requireNotNullNorEmpty(address, "StreamHost address must not be null"); this.port = port; }