test_class.file: imcache-spring/src/test/java/com/cetsoft/imcache/spring/SpringCacheBuilderTest.java
test_class.identifier: SpringCacheBuilderTest
test_case.body: @Test
    public void build() {
      assertTrue(new SpringCacheBuilder("heap").build() instanceof HeapCache);
  
      SpringCacheBuilder builder = new SpringCacheBuilder();
  
      builder.setType("heap");
      assertTrue(builder.build() instanceof HeapCache);
  
      builder.setType("redis");
      builder.setConcurrencyLevel(2);
      builder.setCacheLoader(key -> null);
      builder.setEvictionListener((key, value) -> {
      });
      builder.setIndexHandler(new DefaultIndexHandler<>());
      builder.setRedisHost("localhost");
      builder.setRedisPort(6379);
      builder.setSerializer(new Serializer<Object>() {
        @Override
        public byte[] serialize(Object value) {
          return value.toString().getBytes();
        }
  
        @Override
        public Object deserialize(byte[] payload) {
          return new String(payload);
        }
      });
  
      assertTrue(builder.build() instanceof RedisCache);
  
      builder.setType("offheap");
      builder.setEvictionPeriod(2);
      builder.setHeapCapacity(19999);
      builder.setBufferCleanerPeriod(1000);
      builder.setBufferCleanerThreshold(0.6F);
      OffHeapByteBufferStore bufferStore = new OffHeapByteBufferStore(8388608, 2);
      builder.setBufferStore(bufferStore);
      assertTrue(builder.build("off-heap") instanceof OffHeapCache);
  
      builder.setType("versioned_offheap");
      assertTrue(builder.build() instanceof VersionedOffHeapCache);
    }
test_case.class_method_signature: SpringCacheBuilderTest.build()
test_case.full_signature: @Test public void build()
test_case.identifier: build
test_case.invocations: assertTrue build setType assertTrue build setType setConcurrencyLevel setCacheLoader setEvictionListener setIndexHandler setRedisHost setRedisPort setSerializer getBytes toString assertTrue build setType setEvictionPeriod setHeapCapacity setBufferCleanerPeriod setBufferCleanerThreshold setBufferStore assertTrue build setType assertTrue build
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void build()
focal_class.declarator: type
focal_class.modifier: protected
focal_class.original_string: protected CacheCategory type;
focal_class.type: CacheCategory
focal_class.var_name: type
focal_class.declarator: concurrencyLevel = OffHeapCache.DEFAULT_CONCURRENCY_LEVEL
focal_class.modifier: private
focal_class.original_string: private int concurrencyLevel = OffHeapCache.DEFAULT_CONCURRENCY_LEVEL;
focal_class.type: int
focal_class.var_name: concurrencyLevel
focal_class.declarator: evictionPeriod = OffHeapCache.DEFAULT_EVICTION_PERIOD
focal_class.modifier: private
focal_class.original_string: private long evictionPeriod = OffHeapCache.DEFAULT_EVICTION_PERIOD;
focal_class.type: long
focal_class.var_name: evictionPeriod
focal_class.declarator: bufferCleanerPeriod = OffHeapCache.DEFAULT_BUFFER_CLEANER_PERIOD
focal_class.modifier: private
focal_class.original_string: private long bufferCleanerPeriod = OffHeapCache.DEFAULT_BUFFER_CLEANER_PERIOD;
focal_class.type: long
focal_class.var_name: bufferCleanerPeriod
focal_class.declarator: bufferCleanerThreshold = OffHeapCache.DEFAULT_BUFFER_CLEANER_THRESHOLD
focal_class.modifier: private
focal_class.original_string: private float bufferCleanerThreshold = OffHeapCache.DEFAULT_BUFFER_CLEANER_THRESHOLD;
focal_class.type: float
focal_class.var_name: bufferCleanerThreshold
focal_class.declarator: bufferStore
focal_class.modifier: private
focal_class.original_string: private OffHeapByteBufferStore bufferStore;
focal_class.type: OffHeapByteBufferStore
focal_class.var_name: bufferStore
focal_class.declarator: redisHost = "127.0.0.1"
focal_class.modifier: private
focal_class.original_string: private String redisHost = "127.0.0.1";
focal_class.type: String
focal_class.var_name: redisHost
focal_class.declarator: redisPort = 6379
focal_class.modifier: private
focal_class.original_string: private int redisPort = 6379;
focal_class.type: int
focal_class.var_name: redisPort
focal_class.declarator: heapCapacity = 10000
focal_class.modifier: private
focal_class.original_string: private int heapCapacity = 10000;
focal_class.type: int
focal_class.var_name: heapCapacity
focal_class.file: imcache-spring/src/main/java/com/cetsoft/imcache/spring/SpringCacheBuilder.java
focal_class.identifier: SpringCacheBuilder
focal_class.class_method_signature: SpringCacheBuilder.SpringCacheBuilder()
focal_class.full_signature: public  SpringCacheBuilder()
focal_class.identifier: SpringCacheBuilder
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  SpringCacheBuilder()
focal_class.class_method_signature: SpringCacheBuilder.SpringCacheBuilder(String type)
focal_class.full_signature: public  SpringCacheBuilder(String type)
focal_class.identifier: SpringCacheBuilder
focal_class.modifiers: public
focal_class.parameters: (String type)
focal_class.signature:  SpringCacheBuilder(String type)
focal_class.class_method_signature: SpringCacheBuilder.build()
focal_class.full_signature: public Cache<K, V> build()
focal_class.identifier: build
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Cache<K, V>
focal_class.signature: Cache<K, V> build()
focal_class.class_method_signature: SpringCacheBuilder.build(final String name)
focal_class.full_signature: public Cache<K, V> build(final String name)
focal_class.identifier: build
focal_class.modifiers: public
focal_class.parameters: (final String name)
focal_class.return: Cache<K, V>
focal_class.signature: Cache<K, V> build(final String name)
focal_class.class_method_signature: SpringCacheBuilder.setType(String type)
focal_class.full_signature: public void setType(String type)
focal_class.identifier: setType
focal_class.modifiers: public
focal_class.parameters: (String type)
focal_class.return: void
focal_class.signature: void setType(String type)
focal_class.class_method_signature: SpringCacheBuilder.setConcurrencyLevel(int concurrencyLevel)
focal_class.full_signature: public void setConcurrencyLevel(int concurrencyLevel)
focal_class.identifier: setConcurrencyLevel
focal_class.modifiers: public
focal_class.parameters: (int concurrencyLevel)
focal_class.return: void
focal_class.signature: void setConcurrencyLevel(int concurrencyLevel)
focal_class.class_method_signature: SpringCacheBuilder.setEvictionPeriod(long evictionPeriod)
focal_class.full_signature: public void setEvictionPeriod(long evictionPeriod)
focal_class.identifier: setEvictionPeriod
focal_class.modifiers: public
focal_class.parameters: (long evictionPeriod)
focal_class.return: void
focal_class.signature: void setEvictionPeriod(long evictionPeriod)
focal_class.class_method_signature: SpringCacheBuilder.setBufferCleanerPeriod(long bufferCleanerPeriod)
focal_class.full_signature: public void setBufferCleanerPeriod(long bufferCleanerPeriod)
focal_class.identifier: setBufferCleanerPeriod
focal_class.modifiers: public
focal_class.parameters: (long bufferCleanerPeriod)
focal_class.return: void
focal_class.signature: void setBufferCleanerPeriod(long bufferCleanerPeriod)
focal_class.class_method_signature: SpringCacheBuilder.setBufferCleanerThreshold(float bufferCleanerThreshold)
focal_class.full_signature: public void setBufferCleanerThreshold(float bufferCleanerThreshold)
focal_class.identifier: setBufferCleanerThreshold
focal_class.modifiers: public
focal_class.parameters: (float bufferCleanerThreshold)
focal_class.return: void
focal_class.signature: void setBufferCleanerThreshold(float bufferCleanerThreshold)
focal_class.class_method_signature: SpringCacheBuilder.setSerializer(Serializer<Object> serializer)
focal_class.full_signature: public void setSerializer(Serializer<Object> serializer)
focal_class.identifier: setSerializer
focal_class.modifiers: public
focal_class.parameters: (Serializer<Object> serializer)
focal_class.return: void
focal_class.signature: void setSerializer(Serializer<Object> serializer)
focal_class.class_method_signature: SpringCacheBuilder.setCacheLoader(CacheLoader<Object, Object> cacheLoader)
focal_class.full_signature: public void setCacheLoader(CacheLoader<Object, Object> cacheLoader)
focal_class.identifier: setCacheLoader
focal_class.modifiers: public
focal_class.parameters: (CacheLoader<Object, Object> cacheLoader)
focal_class.return: void
focal_class.signature: void setCacheLoader(CacheLoader<Object, Object> cacheLoader)
focal_class.class_method_signature: SpringCacheBuilder.setEvictionListener(EvictionListener<Object, Object> evictionListener)
focal_class.full_signature: public void setEvictionListener(EvictionListener<Object, Object> evictionListener)
focal_class.identifier: setEvictionListener
focal_class.modifiers: public
focal_class.parameters: (EvictionListener<Object, Object> evictionListener)
focal_class.return: void
focal_class.signature: void setEvictionListener(EvictionListener<Object, Object> evictionListener)
focal_class.class_method_signature: SpringCacheBuilder.setIndexHandler(IndexHandler<Object, Object> indexHandler)
focal_class.full_signature: public void setIndexHandler(IndexHandler<Object, Object> indexHandler)
focal_class.identifier: setIndexHandler
focal_class.modifiers: public
focal_class.parameters: (IndexHandler<Object, Object> indexHandler)
focal_class.return: void
focal_class.signature: void setIndexHandler(IndexHandler<Object, Object> indexHandler)
focal_class.class_method_signature: SpringCacheBuilder.setBufferStore(OffHeapByteBufferStore bufferStore)
focal_class.full_signature: public void setBufferStore(OffHeapByteBufferStore bufferStore)
focal_class.identifier: setBufferStore
focal_class.modifiers: public
focal_class.parameters: (OffHeapByteBufferStore bufferStore)
focal_class.return: void
focal_class.signature: void setBufferStore(OffHeapByteBufferStore bufferStore)
focal_class.class_method_signature: SpringCacheBuilder.setRedisHost(String redisHost)
focal_class.full_signature: public void setRedisHost(String redisHost)
focal_class.identifier: setRedisHost
focal_class.modifiers: public
focal_class.parameters: (String redisHost)
focal_class.return: void
focal_class.signature: void setRedisHost(String redisHost)
focal_class.class_method_signature: SpringCacheBuilder.setRedisPort(int redisPort)
focal_class.full_signature: public void setRedisPort(int redisPort)
focal_class.identifier: setRedisPort
focal_class.modifiers: public
focal_class.parameters: (int redisPort)
focal_class.return: void
focal_class.signature: void setRedisPort(int redisPort)
focal_class.class_method_signature: SpringCacheBuilder.setHeapCapacity(int heapCapacity)
focal_class.full_signature: public void setHeapCapacity(int heapCapacity)
focal_class.identifier: setHeapCapacity
focal_class.modifiers: public
focal_class.parameters: (int heapCapacity)
focal_class.return: void
focal_class.signature: void setHeapCapacity(int heapCapacity)
focal_class.superclass: extends BaseCacheBuilder
focal_method.body: public <K, V> Cache<K, V> build() {
  
      switch (this.type) {
        case OFFHEAP:
          return CacheBuilder.offHeapCache().cacheLoader(cacheLoader)
              .evictionListener(evictionListener)
              .indexHandler(indexHandler).concurrencyLevel(concurrencyLevel)
              .bufferCleanerPeriod(bufferCleanerPeriod).bufferCleanerThreshold(bufferCleanerThreshold)
              .evictionPeriod(evictionPeriod).serializer(serializer).storage(bufferStore).build();
  
        case VERSIONED_OFFHEAP:
          return CacheBuilder.versionedOffHeapCache().cacheLoader(cacheLoader)
              .evictionListener(evictionListener)
              .indexHandler(indexHandler).concurrencyLevel(concurrencyLevel)
              .bufferCleanerPeriod(bufferCleanerPeriod).bufferCleanerThreshold(bufferCleanerThreshold)
              .evictionPeriod(evictionPeriod).serializer(serializer).storage(bufferStore).build();
  
        case REDIS:
          return CacheBuilder.redisCache().cacheLoader(cacheLoader).evictionListener(evictionListener)
              .serializer(serializer).concurrencyLevel(concurrencyLevel).hostName(redisHost)
              .port(redisPort)
              .build();
  
        default:
          return CacheBuilder.heapCache().cacheLoader(cacheLoader).evictionListener(evictionListener)
              .indexHandler(indexHandler).build();
      }
    }
focal_method.class_method_signature: SpringCacheBuilder.build()
focal_method.full_signature: public Cache<K, V> build()
focal_method.identifier: build
focal_method.invocations: build storage serializer evictionPeriod bufferCleanerThreshold bufferCleanerPeriod concurrencyLevel indexHandler evictionListener cacheLoader offHeapCache build storage serializer evictionPeriod bufferCleanerThreshold bufferCleanerPeriod concurrencyLevel indexHandler evictionListener cacheLoader versionedOffHeapCache build port hostName concurrencyLevel serializer evictionListener cacheLoader redisCache build indexHandler evictionListener cacheLoader heapCache
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Cache<K, V>
focal_method.signature: Cache<K, V> build()