use of org.traccar.model.Typed in project traccar by traccar.
the class NotificationManager method getAllNotificationTypes.
public Set<Typed> getAllNotificationTypes() {
Set<Typed> types = new HashSet<>();
Field[] fields = Event.class.getDeclaredFields();
for (Field field : fields) {
if (Modifier.isStatic(field.getModifiers()) && field.getName().startsWith("TYPE_")) {
try {
types.add(new Typed(field.get(null).toString()));
} catch (IllegalArgumentException | IllegalAccessException error) {
Log.warning(error);
}
}
}
return types;
}
use of org.traccar.model.Typed in project traccar by tananaev.
the class CommandsManager method getAllCommandTypes.
public Collection<Typed> getAllCommandTypes() {
List<Typed> result = new ArrayList<>();
Field[] fields = Command.class.getDeclaredFields();
for (Field field : fields) {
if (Modifier.isStatic(field.getModifiers()) && field.getName().startsWith("TYPE_")) {
try {
result.add(new Typed(field.get(null).toString()));
} catch (IllegalArgumentException | IllegalAccessException error) {
LOGGER.warn("Get command types error", error);
}
}
}
return result;
}