List of usage examples for java.util Objects requireNonNull
public static <T> T requireNonNull(T obj)
From source file:com.github.horrorho.inflatabledonkey.cloud.AssetDownloader.java
public AssetDownloader(ChunkEngine chunkEngine) { this.chunkEngine = Objects.requireNonNull(chunkEngine); }
From source file:org.eclipse.hono.deviceregistry.Application.java
/** * Sets the credentials service implementation this server is based on. * // ww w .j a v a 2 s . c om * @param credentialsService The service implementation. * @throws NullPointerException if service is {@code null}. */ @Autowired public final void setCredentialsService(final CredentialsService credentialsService) { this.credentialsService = Objects.requireNonNull(credentialsService); }
From source file:org.eclipse.hono.service.http.HttpServiceBase.java
/** * Adds multiple endpoints to this server. * * @param definedEndpoints The endpoints. *//*from w w w.ja v a 2s.com*/ @Autowired(required = false) public final void addEndpoints(final Set<HttpEndpoint> definedEndpoints) { endpoints.addAll(Objects.requireNonNull(definedEndpoints)); }
From source file:net.maritimecloud.identityregistry.model.Organization.java
/** Copies this organization into the other */ public Organization copyTo(Organization org) { Objects.requireNonNull(org); org.setName(name);//from ww w. jav a 2 s. c o m org.setShortName(shortName); org.setEmail(email); org.setUrl(url); org.setCountry(country); org.setLogo(logo); org.setType(type); org.setOidcClientName(oidcClientName); org.setOidcClientSecret(oidcClientSecret); org.setOidcWellKnownUrl(oidcWellKnownUrl); org.setPasswordHash(passwordHash); return org; }
From source file:net.sf.jabref.exporter.OpenOfficeDocumentCreator.java
@Override public void performExport(final BibDatabaseContext databaseContext, final String file, final Charset encoding, List<BibEntry> entries) throws Exception { Objects.requireNonNull(databaseContext); Objects.requireNonNull(entries); if (!entries.isEmpty()) { // Do not export if no entries OpenOfficeDocumentCreator.exportOpenOfficeCalc(new File(file), databaseContext.getDatabase(), entries); }//ww w. j av a 2s.co m }
From source file:com.avanza.ymer.MirroredObjectDefinition.java
public MirroredObjectDefinition<T> collectionName(String collectionName) { this.collectionName = Objects.requireNonNull(collectionName); return this; }
From source file:org.eclipse.hono.service.monitoring.AbstractMessageSenderConnectionEventProducer.java
/** * A {@link ConnectionEventProducer} which will send events using a provided {@link MessageSender}. * //from w ww .j av a 2s. c o m * @param deviceRegistryClient The client for contacting the device registry. * @param messageSenderClient The client used for sending events. * @param messageSenderSource A function to get the {@link MessageSender} of the {@code messageSenderClient} which * should be used for actually sending the events. */ protected AbstractMessageSenderConnectionEventProducer(final HonoClient deviceRegistryClient, final HonoClient messageSenderClient, final BiFunction<HonoClient, String, Future<MessageSender>> messageSenderSource) { Objects.requireNonNull(deviceRegistryClient); Objects.requireNonNull(messageSenderClient); Objects.requireNonNull(messageSenderSource); this.deviceRegistryClient = deviceRegistryClient; this.messageSenderClient = messageSenderClient; this.messageSenderSource = messageSenderSource; }
From source file:net.sf.jabref.specialfields.SpecialField.java
public String getTextDone(String... params) { Objects.requireNonNull(params); if (isSingleValueField() && (params.length == 1) && (params[0] != null)) { // Single value fields can be toggled only return Localization.lang("Toggled '%0' for %1 entries", getLocalizedFieldName(), params[0]); } else if (!isSingleValueField() && (params.length == 2) && (params[0] != null) && (params[1] != null)) { // setting a multi value special field - the setted value is displayed, too String[] allParams = { getLocalizedFieldName(), params[0], params[1] }; return Localization.lang("Set '%0' to '%1' for %2 entries", allParams); } else if (!isSingleValueField() && (params.length == 1) && (params[0] != null)) { // clearing a multi value specialfield return Localization.lang("Cleared '%0' for %1 entries", getLocalizedFieldName(), params[0]); } else {// www . j a v a 2 s.c om // invalid usage LOGGER.info("Creation of special field status change message failed: illegal argument combination."); return ""; } }
From source file:it.unibo.alchemist.language.protelis.datatype.FieldTroveMapImpl.java
@Override public Object getSample(final DeviceUID n) { Objects.requireNonNull(n); final Pair<DeviceUID, Object> res = fld.get(n.getId()); if (res == null) { throw new NoSuchElementException(n.toString()); }/* w w w . j a v a 2 s.c o m*/ return res.getSecond(); }
From source file:com.smoketurner.notification.application.riak.CursorObject.java
/** * Constructor// w w w . j av a 2 s. co m * * @param key * @param value */ @JsonCreator public CursorObject(@JsonProperty("key") final String key, @JsonProperty("value") final long value) { this.key = Objects.requireNonNull(key); this.value = value; }