Tabnine Logo
CollectionUtils.nullSafeList
Code IndexAdd Tabnine to your IDE (free)

How to use
nullSafeList
method
in
org.springframework.data.gemfire.util.CollectionUtils

Best Java code snippets using org.springframework.data.gemfire.util.CollectionUtils.nullSafeList (Showing top 20 results out of 315)

origin: org.springframework.data/spring-data-geode

/**
 * Returns a {@link List} of application domain object fields to be indexed.
 *
 * @return a {@link List} of application domain object fields to be indexed.
 * @see #getFieldAnalyzers()
 * @see java.util.List
 */
protected List<String> getFields() {
  return nullSafeList(this.fields);
}
origin: org.springframework.data/spring-data-gemfire

/**
 * Returns a {@link List} of application domain object fields to be indexed.
 *
 * @return a {@link List} of application domain object fields to be indexed.
 * @see #getFieldAnalyzers()
 * @see java.util.List
 */
protected List<String> getFields() {
  return nullSafeList(this.fields);
}
origin: org.springframework.data/spring-data-gemfire

/**
 * Sets names of regions to be included for JSON conversion. By default, all regions will be included
 *
 * @param regionNames a List of region names to include
 */
public void setIncludedRegionNames(List<String> regionNames) {
  this.includedRegions = nullSafeList(regionNames);
}
origin: org.springframework.data/spring-data-geode

/**
 * Sets names of regions to be included for JSON conversion. By default, all regions will be included
 *
 * @param regionNames a List of region names to include
 */
public void setIncludedRegionNames(List<String> regionNames) {
  this.includedRegions = nullSafeList(regionNames);
}
origin: org.springframework.data/spring-data-geode

protected List<CacheFactoryBean.JndiDataSource> getJndiDataSources() {
  return nullSafeList(this.jndiDataSources);
}
origin: org.springframework.data/spring-data-gemfire

protected List<TransactionListener> getTransactionListeners() {
  return nullSafeList(this.transactionListeners);
}
origin: org.springframework.data/spring-data-geode

protected List<TransactionListener> getTransactionListeners() {
  return nullSafeList(this.transactionListeners);
}
origin: org.springframework.data/spring-data-gemfire

protected List<CacheFactoryBean.JndiDataSource> getJndiDataSources() {
  return nullSafeList(this.jndiDataSources);
}
origin: org.springframework.data/spring-data-gemfire

public void setFixedPartitionAttributes(List<FixedPartitionAttributes> fixedPartitionAttributes) {
  nullSafeList(fixedPartitionAttributes).forEach(this.partitionAttributesFactory::addFixedPartitionAttributes);
}
origin: org.springframework.data/spring-data-geode

public void setFixedPartitionAttributes(List<FixedPartitionAttributes> fixedPartitionAttributes) {
  nullSafeList(fixedPartitionAttributes).forEach(this.partitionAttributesFactory::addFixedPartitionAttributes);
}
origin: org.springframework.geode/spring-geode-actuator

  private String toCommaDelimitedHostAndPortsString(List<InetSocketAddress> socketAddresses) {

    return StringUtils.collectionToCommaDelimitedString(nullSafeList(socketAddresses).stream()
      .filter(Objects::nonNull)
      .map(socketAddress -> String.format("%1$s:%2$d", socketAddress.getHostName(), socketAddress.getPort()))
      .collect(Collectors.toList()));
  }
}
origin: org.springframework.data/spring-data-gemfire

/**
 * @inheritDoc
 */
@Override
public void afterPropertiesSet() throws Exception {
  nullSafeList(partitionListeners).forEach(partitionAttributesFactory::addPartitionListener);
  this.partitionAttributes = partitionAttributesFactory.create();
}
origin: org.springframework.data/spring-data-gemfire

/**
 * Sets regions to be included for JSON conversion. By default, all regions will be included
 *
 * @param regions a List of region names to include
 */
public void setIncludedRegions(List<Region<?, ?>> regions) {
  nullSafeList(regions).forEach(region -> this.includedRegions.add(toRegionName(region)));
}
origin: org.springframework.data/spring-data-geode

/**
 * @inheritDoc
 */
@Override
public void afterPropertiesSet() throws Exception {
  nullSafeList(partitionListeners).forEach(partitionAttributesFactory::addPartitionListener);
  this.partitionAttributes = partitionAttributesFactory.create();
}
origin: org.springframework.data/spring-data-geode

/**
 * Sets regions to be included for JSON conversion. By default, all regions will be included
 *
 * @param regions a List of region names to include
 */
public void setIncludedRegions(List<Region<?, ?>> regions) {
  nullSafeList(regions).forEach(region -> this.includedRegions.add(toRegionName(region)));
}
origin: org.springframework.data/spring-data-gemfire

private ManagedList<BeanDefinition> parseSnapshots(Element element, ParserContext parserContext,
    String childTagName) {
  ManagedList<BeanDefinition> snapshotBeans = new ManagedList<>();
  nullSafeList(DomUtils.getChildElementsByTagName(element, childTagName)).forEach(childElement ->
    snapshotBeans.add(parseSnapshotMetadata(childElement, parserContext)));
  return snapshotBeans;
}
origin: org.springframework.data/spring-data-geode

private ManagedList<BeanDefinition> parseSnapshots(Element element, ParserContext parserContext,
    String childTagName) {
  ManagedList<BeanDefinition> snapshotBeans = new ManagedList<>();
  nullSafeList(DomUtils.getChildElementsByTagName(element, childTagName)).forEach(childElement ->
    snapshotBeans.add(parseSnapshotMetadata(childElement, parserContext)));
  return snapshotBeans;
}
origin: org.springframework.data/spring-data-gemfire

@Override
protected void doInit() {
  Assert.state(this.asyncEventListener != null, "AsyncEventListener must not be null");
  AsyncEventQueueFactory asyncEventQueueFactory =
    this.factory != null ? (AsyncEventQueueFactory) this.factory : this.cache.createAsyncEventQueueFactory();
  Optional.ofNullable(this.batchConflationEnabled).ifPresent(asyncEventQueueFactory::setBatchConflationEnabled);
  Optional.ofNullable(this.batchSize).ifPresent(asyncEventQueueFactory::setBatchSize);
  Optional.ofNullable(this.batchTimeInterval).ifPresent(asyncEventQueueFactory::setBatchTimeInterval);
  Optional.ofNullable(this.diskStoreReference).ifPresent(asyncEventQueueFactory::setDiskStoreName);
  Optional.ofNullable(this.diskSynchronous).ifPresent(asyncEventQueueFactory::setDiskSynchronous);
  Optional.ofNullable(this.dispatcherThreads).ifPresent(asyncEventQueueFactory::setDispatcherThreads);
  Optional.ofNullable(this.forwardExpirationDestroy).ifPresent(asyncEventQueueFactory::setForwardExpirationDestroy);
  Optional.ofNullable(this.gatewayEventSubstitutionFilter).ifPresent(asyncEventQueueFactory::setGatewayEventSubstitutionListener);
  Optional.ofNullable(this.maximumQueueMemory).ifPresent(asyncEventQueueFactory::setMaximumQueueMemory);
  Optional.ofNullable(this.persistent).ifPresent(asyncEventQueueFactory::setPersistent);
  asyncEventQueueFactory.setParallel(isParallelEventQueue());
  nullSafeList(this.gatewayEventFilters).forEach(asyncEventQueueFactory::addGatewayEventFilter);
  if (this.orderPolicy != null) {
    Assert.state(isSerialEventQueue(), "OrderPolicy cannot be used with a Parallel AsyncEventQueue");
    asyncEventQueueFactory.setOrderPolicy(this.orderPolicy);
  }
  setAsyncEventQueue(asyncEventQueueFactory.create(getName(), this.asyncEventListener));
}
origin: org.springframework.data/spring-data-geode

@Override
protected void doInit() {
  Assert.state(this.asyncEventListener != null, "AsyncEventListener must not be null");
  AsyncEventQueueFactory asyncEventQueueFactory =
    this.factory != null ? (AsyncEventQueueFactory) this.factory : this.cache.createAsyncEventQueueFactory();
  Optional.ofNullable(this.batchConflationEnabled).ifPresent(asyncEventQueueFactory::setBatchConflationEnabled);
  Optional.ofNullable(this.batchSize).ifPresent(asyncEventQueueFactory::setBatchSize);
  Optional.ofNullable(this.batchTimeInterval).ifPresent(asyncEventQueueFactory::setBatchTimeInterval);
  Optional.ofNullable(this.diskStoreReference).ifPresent(asyncEventQueueFactory::setDiskStoreName);
  Optional.ofNullable(this.diskSynchronous).ifPresent(asyncEventQueueFactory::setDiskSynchronous);
  Optional.ofNullable(this.dispatcherThreads).ifPresent(asyncEventQueueFactory::setDispatcherThreads);
  Optional.ofNullable(this.forwardExpirationDestroy).ifPresent(asyncEventQueueFactory::setForwardExpirationDestroy);
  Optional.ofNullable(this.gatewayEventSubstitutionFilter).ifPresent(asyncEventQueueFactory::setGatewayEventSubstitutionListener);
  Optional.ofNullable(this.maximumQueueMemory).ifPresent(asyncEventQueueFactory::setMaximumQueueMemory);
  Optional.ofNullable(this.persistent).ifPresent(asyncEventQueueFactory::setPersistent);
  asyncEventQueueFactory.setParallel(isParallelEventQueue());
  nullSafeList(this.gatewayEventFilters).forEach(asyncEventQueueFactory::addGatewayEventFilter);
  if (this.orderPolicy != null) {
    Assert.state(isSerialEventQueue(), "OrderPolicy cannot be used with a Parallel AsyncEventQueue");
    asyncEventQueueFactory.setOrderPolicy(this.orderPolicy);
  }
  setAsyncEventQueue(asyncEventQueueFactory.create(getName(), this.asyncEventListener));
}
origin: org.springframework.data/spring-data-gemfire

/**
 * @inheritDoc
 */
@Override
protected void doInit() throws Exception {
  GatewayReceiverFactory gatewayReceiverFactory = cache.createGatewayReceiverFactory();
  if (StringUtils.hasText(bindAddress)) {
    gatewayReceiverFactory.setBindAddress(bindAddress);
  }
  if (StringUtils.hasText(hostnameForSenders)) {
    gatewayReceiverFactory.setHostnameForSenders(hostnameForSenders);
  }
  int localStartPort = defaultPort(startPort, GatewayReceiver.DEFAULT_START_PORT);
  int localEndPort = defaultPort(endPort, GatewayReceiver.DEFAULT_END_PORT);
  Assert.isTrue(localStartPort <= localEndPort,
    String.format("'startPort' must be less than or equal to %d.", localEndPort));
  gatewayReceiverFactory.setStartPort(localStartPort);
  gatewayReceiverFactory.setEndPort(localEndPort);
  gatewayReceiverFactory.setManualStart(manualStart);
  if (maximumTimeBetweenPings != null) {
    gatewayReceiverFactory.setMaximumTimeBetweenPings(maximumTimeBetweenPings);
  }
  if (socketBufferSize != null) {
    gatewayReceiverFactory.setSocketBufferSize(socketBufferSize);
  }
  for (GatewayTransportFilter transportFilter : CollectionUtils.nullSafeList(transportFilters)) {
    gatewayReceiverFactory.addGatewayTransportFilter(transportFilter);
  }
  gatewayReceiver = gatewayReceiverFactory.create();
}
org.springframework.data.gemfire.utilCollectionUtilsnullSafeList

Javadoc

Null-safe operation returning the given List if not nullor an empty List if null.

Popular methods of CollectionUtils

  • asSet
    Returns an unmodifiable Set containing the elements from the given object array.
  • nullSafeIterable
    Returns the given Iterable if not null or empty, otherwise returns the defaultIterable.
  • nullSafeMap
    Null-safe operation returning the given Map if not nullor an empty Map if null.
  • nullSafeSet
    Null-safe operation returning the given Set if not nullor an empty Set if null.
  • iterable
    Adapts the given Iterator as an Iterable object for use within a for each loop.
  • addAll
    Adds all elements from the given Iterable to the Collection.
  • containsAny
    Null-safe method to determines whether the given Collection contains any elements from the given arr
  • emptyIterable
    Returns an empty Iterable object.
  • isEmpty
  • newSortedMap
  • nullSafeCollection
    Null-safe operation returning the given Collection if not nullor an empty Collection (implemented wi
  • nullSafeEnumeration
    Null-safe operation returning the given Enumeration if not nullor an Collections#emptyEnumeration()
  • nullSafeCollection,
  • nullSafeEnumeration,
  • nullSafeIsEmpty,
  • nullSafeIterator,
  • nullSafeSize,
  • toIterator,
  • toString

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • compareTo (BigDecimal)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now