Java Code Examples for io.vavr.collection.HashMap#empty()

The following examples show how to use io.vavr.collection.HashMap#empty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XMLToJSON.java    From ts-reaktive with MIT License 5 votes vote down vote up
private Map<QName,XSParticle> getValidSubTags(XSElementDeclaration elmt) {
    if (!(elmt.getTypeDefinition() instanceof XSComplexTypeDefinition)) {
        return HashMap.empty();
    }
    
    XSComplexTypeDefinition type = (XSComplexTypeDefinition) elmt.getTypeDefinition();
    if (type.getParticle() == null || !(type.getParticle().getTerm() instanceof XSModelGroup)) {
        return HashMap.empty();
    }
    
    XSModelGroup group = (XSModelGroup) type.getParticle().getTerm();
    if (group.getCompositor() != XSModelGroup.COMPOSITOR_SEQUENCE && group.getCompositor() != XSModelGroup.COMPOSITOR_CHOICE) {
        return HashMap.empty();
    }
    
    // We don't care whether it's SEQUENCE or CHOICE, we only want to know what are the valid sub-elements at this level.
    XSObjectList particles = group.getParticles();
    Map<QName,XSParticle> content = HashMap.empty();
    for (int j = 0; j < particles.getLength(); j++) {
        XSParticle sub = (XSParticle) particles.get(j);
        if (sub.getTerm() instanceof XSElementDeclaration) {
            XSElementDeclaration term = (XSElementDeclaration) sub.getTerm();
            content = content.put(new QName(term.getNamespace(), term.getName()), sub);
        }
    }
    return content;
}
 
Example 2
Source File: InMemoryThreadPoolBulkheadRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public InMemoryThreadPoolBulkheadRegistry(Map<String, ThreadPoolBulkheadConfig> configs) {
    this(configs, HashMap.empty());
}
 
Example 3
Source File: InMemoryRateLimiterRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public InMemoryRateLimiterRegistry(Map<String, RateLimiterConfig> configs,
    List<RegistryEventConsumer<RateLimiter>> registryEventConsumers) {
    this(configs, registryEventConsumers, HashMap.empty());
}
 
Example 4
Source File: AtomicRateLimiter.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public AtomicRateLimiter(String name, RateLimiterConfig rateLimiterConfig) {
    this(name, rateLimiterConfig, HashMap.empty());
}
 
Example 5
Source File: RetryImpl.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public RetryImpl(String name, RetryConfig config) {
    this(name, config, HashMap.empty());
}
 
Example 6
Source File: InMemoryBulkheadRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public InMemoryBulkheadRegistry(
    Map<String, BulkheadConfig> configs,
    RegistryEventConsumer<Bulkhead> registryEventConsumer) {
    this(configs, registryEventConsumer, HashMap.empty());
}
 
Example 7
Source File: InMemoryRetryRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public InMemoryRetryRegistry(Map<String, RetryConfig> configs) {
    this(configs, HashMap.empty());
}
 
Example 8
Source File: InMemoryCircuitBreakerRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
/**
 * The constructor with default default.
 */
public InMemoryCircuitBreakerRegistry() {
    this(HashMap.empty());
}
 
Example 9
Source File: InMemoryRetryRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public InMemoryRetryRegistry(Map<String, RetryConfig> configs,
    RegistryEventConsumer<Retry> registryEventConsumer) {
    this(configs, registryEventConsumer, HashMap.empty());
}
 
Example 10
Source File: InMemoryRetryRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public InMemoryRetryRegistry(RetryConfig defaultConfig,
    List<RegistryEventConsumer<Retry>> registryEventConsumers) {
    this(defaultConfig, registryEventConsumers, HashMap.empty());
}
 
Example 11
Source File: InMemoryRateLimiterRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public InMemoryRateLimiterRegistry(Map<String, RateLimiterConfig> configs) {
    this(configs, HashMap.empty());
}
 
Example 12
Source File: AbstractRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public AbstractRegistry(C defaultConfig, RegistryEventConsumer<E> registryEventConsumer) {
    this(defaultConfig, registryEventConsumer, HashMap.empty());
}
 
Example 13
Source File: AbstractRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public AbstractRegistry(C defaultConfig) {
    this(defaultConfig, HashMap.empty());
}
 
Example 14
Source File: ACLBuilder.java    From ts-reaktive with MIT License 4 votes vote down vote up
/**
 * Returns a new, empty, {@link ACL} which will use this ACLBuilder to resolve changes.
 */
public ACL<R,C> empty() {
    return new ACL<>(this, HashMap.empty());
}
 
Example 15
Source File: InMemoryRetryRegistry.java    From resilience4j with Apache License 2.0 2 votes vote down vote up
/**
 * The constructor with custom default config.
 *
 * @param defaultConfig The default config.
 */
public InMemoryRetryRegistry(RetryConfig defaultConfig) {
    this(defaultConfig, HashMap.empty());
}
 
Example 16
Source File: SemaphoreBulkhead.java    From resilience4j with Apache License 2.0 2 votes vote down vote up
/**
 * Create a bulkhead using a configuration supplier
 *
 * @param name           the name of this bulkhead
 * @param configSupplier BulkheadConfig supplier
 */
public SemaphoreBulkhead(String name, Supplier<BulkheadConfig> configSupplier) {
    this(name, configSupplier.get(), HashMap.empty());
}
 
Example 17
Source File: SemaphoreBasedRateLimiter.java    From resilience4j with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a RateLimiter.
 *
 * @param name              the name of the RateLimiter
 * @param rateLimiterConfig The RateLimiter configuration.
 */
public SemaphoreBasedRateLimiter(final String name, final RateLimiterConfig rateLimiterConfig) {
    this(name, rateLimiterConfig, HashMap.empty());
}
 
Example 18
Source File: SemaphoreBulkhead.java    From resilience4j with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a bulkhead with a default config.
 *
 * @param name the name of this bulkhead
 */
public SemaphoreBulkhead(String name) {
    this(name, BulkheadConfig.ofDefaults(), HashMap.empty());
}
 
Example 19
Source File: FixedThreadPoolBulkhead.java    From resilience4j with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a bulkhead using a configuration supplied
 *
 * @param name           the name of this bulkhead
 * @param bulkheadConfig custom bulkhead configuration
 */
public FixedThreadPoolBulkhead(String name, @Nullable ThreadPoolBulkheadConfig bulkheadConfig) {
    this(name, bulkheadConfig, HashMap.empty());
}
 
Example 20
Source File: FixedThreadPoolBulkhead.java    From resilience4j with Apache License 2.0 2 votes vote down vote up
/**
 * Create a bulkhead using a configuration supplier
 *
 * @param name           the name of this bulkhead
 * @param configSupplier BulkheadConfig supplier
 */
public FixedThreadPoolBulkhead(String name, Supplier<ThreadPoolBulkheadConfig> configSupplier) {
    this(name, configSupplier.get(), HashMap.empty());
}