Skip to content

Commit

Permalink
ns
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Apr 26, 2024
1 parent 744c0bf commit e51b65c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/org/jgroups/util/Util.java
Expand Up @@ -3506,6 +3506,18 @@ public static List<Object> getComponents(Object target) {
return components;
}

public static List<Class<?>> getComponents(Class<?> clazz) {
if(clazz == null)
return null;
Field[] fields=Util.getAllDeclaredFieldsWithAnnotations(clazz, Component.class);
if(fields == null || fields.length == 0)
return null;
List<Class<?>> components=new ArrayList<>(fields.length);
for(Field f: fields)
components.add(f.getType());
return components;
}

/**
* Applies a function to all fields annotated with @Component
* @param target The target object
Expand Down

0 comments on commit e51b65c

Please sign in to comment.