Class AnnotatedScoreResolver
- java.lang.Object
-
- org.oxerr.spring.cache.redis.scored.score.resolver.annotated.AnnotatedScoreResolver
-
- All Implemented Interfaces:
Serializable
,ScoreResolver
public class AnnotatedScoreResolver extends Object implements ScoreResolver
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
AnnotatedScoreResolver.AnnotatedElementWrapper<T extends AnnotatedElement>
private class
AnnotatedScoreResolver.OrderedAnnotatedElement<T extends AnnotatedElement>
-
Field Summary
Fields Modifier and Type Field Description private Map<Class<?>,AnnotatedScoreResolver.AnnotatedElementWrapper<? extends AnnotatedElement>>
annotatedElements
private Class<? extends Annotation>
annotationType
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description AnnotatedScoreResolver(Class<? extends Annotation> annotationType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Double
extractScore(Object version)
private AnnotatedScoreResolver.AnnotatedElementWrapper<? extends AnnotatedElement>
getAnnotatedElement(Class<?> valueType)
private Optional<Double>
getScore(Object value)
private Optional<Double>
getScoreInternal(Object value)
private void
readObject(ObjectInputStream in)
private AnnotatedScoreResolver.AnnotatedElementWrapper<? extends AnnotatedElement>
resolveAnnotatedElement(Class<?> valueType)
Optional<Double>
resolveScore(Object value)
Resolve score from the value.private void
writeObject(ObjectOutputStream out)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
annotatedElements
private transient Map<Class<?>,AnnotatedScoreResolver.AnnotatedElementWrapper<? extends AnnotatedElement>> annotatedElements
-
annotationType
private Class<? extends Annotation> annotationType
-
-
Constructor Detail
-
AnnotatedScoreResolver
public AnnotatedScoreResolver(Class<? extends Annotation> annotationType)
-
-
Method Detail
-
resolveScore
public Optional<Double> resolveScore(@Nullable Object value)
Description copied from interface:ScoreResolver
Resolve score from the value.- Specified by:
resolveScore
in interfaceScoreResolver
- Parameters:
value
- the value, may be null.- Returns:
- the score.
-
getScoreInternal
private Optional<Double> getScoreInternal(@NonNull Object value) throws IllegalAccessException, InvocationTargetException
-
getAnnotatedElement
private AnnotatedScoreResolver.AnnotatedElementWrapper<? extends AnnotatedElement> getAnnotatedElement(Class<?> valueType)
-
resolveAnnotatedElement
private AnnotatedScoreResolver.AnnotatedElementWrapper<? extends AnnotatedElement> resolveAnnotatedElement(Class<?> valueType)
-
writeObject
private void writeObject(ObjectOutputStream out) throws IOException
- Throws:
IOException
-
readObject
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
-