Class CacheObjectUtils


  • public class CacheObjectUtils
    extends Object
    Cache object utility methods.
    • Method Detail

      • unwrapBinaryIfNeeded

        public static Object unwrapBinaryIfNeeded​(CacheObjectValueContext ctx,
                                                  CacheObject o,
                                                  boolean keepBinary,
                                                  boolean cpy)
        Parameters:
        o - Object to unwrap.
        keepBinary - Keep binary flag.
        cpy - Copy value flag.
        Returns:
        Unwrapped object.
      • unwrapBinaryIfNeeded

        public static Object unwrapBinaryIfNeeded​(CacheObjectValueContext ctx,
                                                  Object o,
                                                  boolean keepBinary,
                                                  boolean cpy,
                                                  @Nullable
                                                  @Nullable ClassLoader ldr)
        Parameters:
        ctx - Cache object context.
        o - Object to unwrap.
        keepBinary - Keep binary flag.
        cpy - Copy value flag.
        ldr - Class loader, used for deserialization from binary representation.
        Returns:
        Unwrapped object.
      • unwrapBinariesIfNeeded

        public static Collection<Object> unwrapBinariesIfNeeded​(CacheObjectValueContext ctx,
                                                                Collection<?> col,
                                                                boolean keepBinary)
        Parameters:
        col - Collection of objects to unwrap.
        keepBinary - Keep binary flag.
        Returns:
        Unwrapped collection.
      • unwrapBinary

        public static Object unwrapBinary​(CacheObjectValueContext ctx,
                                          Object o,
                                          boolean keepBinary,
                                          boolean cpy,
                                          @Nullable
                                          @Nullable ClassLoader ldr)
        Unwraps an object for end user.
        Parameters:
        ctx - Cache object context.
        o - Object to unwrap.
        keepBinary - False when need to deserialize object from a binary one, true otherwise.
        cpy - True means the object will be copied before return, false otherwise.
        ldr - Class loader, used for deserialization from binary representation.
        Returns:
        Unwrapped object.