API comments added

pull/611/head
Rui Gu 9 years ago
parent 3af0a46078
commit cfbd2ce874

@ -24,7 +24,26 @@ import org.redisson.liveobject.resolver.Resolver;
*/
public interface ResolverProvider {
/**
* To retrieve a resolver based on the the class requiring values to be
* resolved, the resolver type, and annotation which may carry any required
* configurations.
*
* @param cls the class requires value to be resolved
* @param resolverClass the resolver type
* @param anno annotation with configurations
* @return a Resolver instance
*/
Resolver getResolver(Class<?> cls, Class<? extends Resolver> resolverClass, Annotation anno);
/**
* To register a resolver based on the the class it can provide value to,
* the resolver type, the resolver instance to be cached.
*
* @param cls
* @param resolverClass
* @param resolver
*/
void registerResolver(Class<?> cls, Class<? extends Resolver> resolverClass, Resolver resolver);
}

@ -20,14 +20,26 @@ import java.lang.annotation.Annotation;
import org.redisson.api.RedissonClient;
/**
* A resolver is used to provide value based on contextual parameters
*
* @author Rui Gu (https://github.com/jackygurui)
* @param <T> Field instance
* @param <T> Field instance type
* @param <A> Annotation to resolve
* @param <V> Value type
*/
public interface Resolver<T, A extends Annotation, V> {
/**
* Used to provide a value instance based on contextual parameters.
*
* Actual behavior may vary depending on implementation
*
* @param value
* @param annotation
* @param idFieldName
* @param redisson
* @return resolved value
*/
public V resolve(T value, A annotation, String idFieldName, RedissonClient redisson);
}

Loading…
Cancel
Save