org.eclipse.jgit.storage.dht.spi.cache
Class CacheService.Change

java.lang.Object
  extended by org.eclipse.jgit.storage.dht.spi.cache.CacheService.Change
Enclosing interface:
CacheService

public static class CacheService.Change
extends java.lang.Object

A change to the cache.


Nested Class Summary
static class CacheService.Change.Type
          Operation the change describes.
 
Constructor Summary
CacheService.Change(CacheService.Change.Type type, CacheKey key, byte[] data)
          Initialize a new change.
 
Method Summary
 byte[] getData()
           
 CacheKey getKey()
           
 CacheService.Change.Type getType()
           
static CacheService.Change put(CacheKey key, byte[] data)
          Initialize a put operation.
static CacheService.Change putIfAbsent(CacheKey key, byte[] data)
          Initialize a put operation.
static CacheService.Change remove(CacheKey key)
          Initialize a remove operation.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheService.Change

public CacheService.Change(CacheService.Change.Type type,
                           CacheKey key,
                           byte[] data)
Initialize a new change.

Parameters:
type -
key -
data -
Method Detail

put

public static CacheService.Change put(CacheKey key,
                                      byte[] data)
Initialize a put operation.

Parameters:
key - the key to store.
data - the value to store.
Returns:
the operation.

putIfAbsent

public static CacheService.Change putIfAbsent(CacheKey key,
                                              byte[] data)
Initialize a put operation.

Parameters:
key - the key to store.
data - the value to store.
Returns:
the operation.

remove

public static CacheService.Change remove(CacheKey key)
Initialize a remove operation.

Parameters:
key - the key to remove.
Returns:
the operation.

getType

public CacheService.Change.Type getType()
Returns:
type of change that will take place.

getKey

public CacheKey getKey()
Returns:
the key that will be modified.

getData

public byte[] getData()
Returns:
new data value if this is a PUT type of change.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.