use of javax.annotation.CheckReturnValue in project JMRI by JMRI.
the class AbstractCatalogTree method getListenerRefs.
/* This allows a meaning full list of places where the bean is in use!*/
@CheckReturnValue
@Override
public synchronized ArrayList<String> getListenerRefs() {
ArrayList<String> list = new ArrayList<>();
Enumeration<PropertyChangeListener> en = listenerRefs.keys();
while (en.hasMoreElements()) {
PropertyChangeListener l = en.nextElement();
list.add(listenerRefs.get(l));
}
return list;
}
use of javax.annotation.CheckReturnValue in project JMRI by JMRI.
the class AbstractCatalogTree method getPropertyChangeListenersByReference.
@CheckReturnValue
@Override
public synchronized PropertyChangeListener[] getPropertyChangeListenersByReference(String name) {
ArrayList<PropertyChangeListener> list = new ArrayList<>();
Enumeration<PropertyChangeListener> en = register.keys();
while (en.hasMoreElements()) {
PropertyChangeListener l = en.nextElement();
if (register.get(l).equals(name)) {
list.add(l);
}
}
return list.toArray(new PropertyChangeListener[list.size()]);
}
use of javax.annotation.CheckReturnValue in project core-java by SpineEventEngine.
the class HandlerMethod method getHandledMessageClasses.
/**
* Returns types of messages handled by the passed class.
*
* @return immutable set of message classes or an empty set
*/
@CheckReturnValue
static ImmutableSet<Class<? extends Message>> getHandledMessageClasses(Class<?> cls, Predicate<Method> predicate) {
final ImmutableSet.Builder<Class<? extends Message>> builder = ImmutableSet.builder();
for (Method method : cls.getDeclaredMethods()) {
final boolean methodMatches = predicate.apply(method);
if (methodMatches) {
final Class<? extends Message> firstParamType = getFirstParamType(method);
builder.add(firstParamType);
}
}
return builder.build();
}
Aggregations