protected AbstractHttpOverXmpp(String element, Builder<?, ?> builder) { super(element, NAMESPACE); this.headers = builder.headers; this.data = builder.data; this.version = Objects.requireNonNull(builder.version, "version must not be null"); }
protected EncryptedOpenPgpContentElement(Set<Jid> to, String rpad, Date timestamp, List<ExtensionElement> payload) { super(Objects.requireNonNullNorEmpty( to, "Encrypted OpenPGP content elements must have at least one 'to' attribute."), timestamp, payload); this.rpad = Objects.requireNonNull(rpad); }
private HttpOverXmppResp(Builder builder) { super(ELEMENT, builder); this.statusCode = Objects.requireNonNull(builder.statusCode, "statusCode must not be null"); this.statusMessage = builder.statusMessage; }
/** * Creates a NOT filter using the specified filter. * * @param filter the filter. */ public NotFilter(StanzaFilter filter) { this.filter = Objects.requireNonNull(filter, "Parameter must not be null."); }
/** * Sets the type of the IQ packet. * <p> * Since the type of an IQ must present, an IllegalArgmentException will be thrown when type is * <code>null</code>. * </p> * * @param type the type of the IQ packet. */ public void setType(Type type) { this.type = Objects.requireNonNull(type, "type must not be null"); }
/** * Set the DNS resolver that should be used to perform DNS lookups. * * @param resolver */ public static void setDNSResolver(DNSResolver resolver) { dnsResolver = Objects.requireNonNull(resolver); }
/** * Set the DANE provider that should be used when DANE is enabled. * * @param daneProvider */ public static void setDaneProvider(SmackDaneProvider daneProvider) { DNSUtil.daneProvider = Objects.requireNonNull(daneProvider); }
/** * Create a new OmemoMessageElement from a header and a payload. * * @param header header of the message * @param payload payload */ public OmemoElement(OmemoHeaderElement header, byte[] payload) { this.header = Objects.requireNonNull(header); this.payload = payload; }
/** * Create a new IdleElement. * @param since date of last user interaction */ public IdleElement(Date since) { this.since = Objects.requireNonNull(since); }
protected AbstractOpenPgpStore(OpenPgpKeyStore keyStore, OpenPgpMetadataStore metadataStore, OpenPgpTrustStore trustStore) { this.keyStore = Objects.requireNonNull(keyStore); this.metadataStore = Objects.requireNonNull(metadataStore); this.trustStore = Objects.requireNonNull(trustStore); }
/** * Set how Smack behaves when an unknown IQ request has been received. * * @param unknownIqRequestReplyMode reply mode. */ public void setUnknownIqRequestReplyMode(UnknownIqRequestReplyMode unknownIqRequestReplyMode) { this.unknownIqRequestReplyMode = Objects.requireNonNull(unknownIqRequestReplyMode, "Mode must not be null"); }
public void signal(R result) { synchronized (this) { this.result = Objects.requireNonNull(result); notifyAll(); } }
/** * Creates an filter using the specified filters. * * @param filters the filters to add. */ protected AbstractListFilter(StanzaFilter... filters) { Objects.requireNonNull(filters, "Parameter must not be null."); for (StanzaFilter filter : filters) { Objects.requireNonNull(filter, "Parameter must not be null."); } this.filters = new ArrayList<StanzaFilter>(Arrays.asList(filters)); }
public Checksum(JingleContent.Creator creator, String name, JingleFileTransferChild file) { this.creator = creator; this.name = name; this.file = Objects.requireNonNull(file, "file MUST NOT be null."); Objects.requireNonNull(file.getHash(), "file MUST contain at least one hash element."); }
/** * Constructor. * * @param bytes bytes of the XML representation of the decrypted {@link OpenPgpContentElement}. * @param state {@link State} of the {@link OpenPgpContentElement}. * @param metadata metadata about the encryption. */ public OpenPgpMessage(byte[] bytes, State state, OpenPgpMetadata metadata) { this(new String(Objects.requireNonNull(bytes), Charset.forName("UTF-8")), state, metadata); }
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; }
/** * 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; }
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)"); }
public HostedRoom(DiscoverItems.Item item) { jid = Objects.requireNonNull(item.getEntityID().asEntityBareJidIfPossible(), "The discovered item must be an entity bare JID"); name = item.getName(); }
protected OpenPgpContentElement(Set<Jid> to, Date timestamp, List<ExtensionElement> payload) { this.to = to; this.timestamp = Objects.requireNonNull(timestamp); this.payload = new MultiMap<>(); for (ExtensionElement e : payload) { this.payload.put(XmppStringUtils.generateKey(e.getElementName(), e.getNamespace()), e); } }