public enum ConflictResolverFactory extends Enum<ConflictResolverFactory>
When you have multiple writers there may be multiple versions of the same object stored in Riak. When fetching all of these will be returned and you will need to resolve the conflict.
To facilitate this, you can store an instance of the ConflictResolver
in this factory for a class. It will then be used by the FetchValue.Response
to resolve a set a of siblings to a single object.
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
<T> ConflictResolver<T> |
getConflictResolver(Class<T> clazz) |
<T> ConflictResolver<T> |
getConflictResolver(com.fasterxml.jackson.core.type.TypeReference<T> typeReference) |
static ConflictResolverFactory |
getInstance()
Returns the instance of the ConflictResolverFactory.
|
<T> void |
registerConflictResolver(Class<T> clazz,
ConflictResolver<T> resolver)
Register a ConflictResolver.
|
<T> void |
registerConflictResolver(com.fasterxml.jackson.core.type.TypeReference<T> typeReference,
ConflictResolver<T> resolver) |
<T> void |
unregisterConflictResolver(Class<T> clazz)
Unregister a ConflictResolver.
|
<T> void |
unregisterConflictResolver(com.fasterxml.jackson.core.type.TypeReference<T> typeReference) |
static ConflictResolverFactory |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ConflictResolverFactory[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ConflictResolverFactory INSTANCE
public static ConflictResolverFactory[] values()
for (ConflictResolverFactory c : ConflictResolverFactory.values()) System.out.println(c);
public static ConflictResolverFactory valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic static ConflictResolverFactory getInstance()
public <T> ConflictResolver<T> getConflictResolver(Class<T> clazz)
public <T> ConflictResolver<T> getConflictResolver(com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
public <T> void registerConflictResolver(Class<T> clazz, ConflictResolver<T> resolver)
The instance provided will be used to resolve siblings for the given type.
T
- The type being resolvedclazz
- the class of the type being resolvedresolver
- an instance of a class implementing ConflictResolver.public <T> void registerConflictResolver(com.fasterxml.jackson.core.type.TypeReference<T> typeReference, ConflictResolver<T> resolver)
public <T> void unregisterConflictResolver(Class<T> clazz)
T
- The type being Resolvedclazz
- the class of the type being resolved.public <T> void unregisterConflictResolver(com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
Copyright © 2014. All rights reserved.