
com.codeheadsystems.queue.factory.QueueConfigurationFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of local-queue Show documentation
Show all versions of local-queue Show documentation
LQ: a minimalistic local queue
The newest version!
package com.codeheadsystems.queue.factory;
import com.codeheadsystems.queue.ImmutableQueueConfiguration;
import com.codeheadsystems.queue.QueueConfiguration;
import java.util.Optional;
import javax.inject.Inject;
import javax.inject.Singleton;
/**
* Not really a factory. Just a way to get the configuration from the optional.
*/
@Singleton
public class QueueConfigurationFactory {
private final QueueConfiguration queueConfiguration;
/**
* Instantiates a new Queue configuration factory.
*
* @param optionalQueueConfiguration the optional queue configuration
*/
@Inject
public QueueConfigurationFactory(final Optional optionalQueueConfiguration) {
this.queueConfiguration = optionalQueueConfiguration
.orElseGet(() -> ImmutableQueueConfiguration.builder().build());
}
/**
* Queue configuration queue configuration.
*
* @return the queue configuration
*/
public QueueConfiguration queueConfiguration() {
return queueConfiguration;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy