0

добавлены методы поиска полей по аннотации

This commit is contained in:
2020-04-17 18:29:46 +03:00
parent a16fed9785
commit 62b93916f9
5 changed files with 45 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package ru.dmitriymx.reflection;
import lombok.EqualsAndHashCode;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
@@ -67,6 +68,10 @@ public class ReflectionField {
return Modifier.isStatic(field.getModifiers());
}
public <T extends Annotation> T annotation(Class<T> annotationType) {
return field.getAnnotation(annotationType);
}
@Override
public String toString() {
return "ReflectionField{" +