All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.cache.impl.Caches Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.cache.impl;

import org.infinispan.Cache;
import org.infinispan.commands.FlagAffectedCommand;
import org.infinispan.commons.util.EnumUtil;
import org.infinispan.context.Flag;

/**
 * Utility methods for dealing with caches.
 *
 * @author Dan Berindei
 * @since 9.0
 */
public class Caches {
   private Caches() {
   }

   public static  Cache getCacheWithFlags(Cache cache, FlagAffectedCommand command) {
      long flags = command.getFlagsBitSet();
      if (flags != EnumUtil.EMPTY_BIT_SET) {
         return cache.getAdvancedCache().withFlags(EnumUtil.enumArrayOf(flags, Flag.class));
      } else {
         return cache;
      }
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy