use of com.karumi.rosie.domain.usecase.annotation.UseCase in project Rosie by Karumi.
the class UseCaseFilter method getMethodMatchingName.
private static List<Method> getMethodMatchingName(UseCaseParams useCaseParams, List<Method> methodsFiltered) {
String nameUseCase = useCaseParams.getUseCaseName();
if (nameUseCase == null || nameUseCase.equals("")) {
return methodsFiltered;
}
Iterator<Method> iteratorMethods = methodsFiltered.iterator();
while (iteratorMethods.hasNext()) {
Method method = iteratorMethods.next();
UseCase annotation = method.getAnnotation(UseCase.class);
if (!(annotation.name().equals(nameUseCase))) {
iteratorMethods.remove();
}
}
return methodsFiltered;
}
use of com.karumi.rosie.domain.usecase.annotation.UseCase in project Rosie by Karumi.
the class UseCaseFilter method getAnnotatedUseCaseMethods.
private static List<Method> getAnnotatedUseCaseMethods(Object target) {
List<Method> useCaseMethods = new ArrayList<>();
Method[] methods = target.getClass().getMethods();
for (Method method : methods) {
UseCase useCaseMethod = method.getAnnotation(UseCase.class);
if (useCaseMethod != null) {
useCaseMethods.add(method);
}
}
return useCaseMethods;
}
use of com.karumi.rosie.domain.usecase.annotation.UseCase in project Rosie by Karumi.
the class GetComicSeriesDetails method getComicSeriesDetails.
@UseCase
public void getComicSeriesDetails(int comicSeriesKey) throws Exception {
ComicSeries comicSeries = repository.getComicSeriesDetail(comicSeriesKey);
notifySuccess(comicSeries);
}
use of com.karumi.rosie.domain.usecase.annotation.UseCase in project Rosie by Karumi.
the class GetCharacterDetails method getCharacterDetails.
@UseCase
public void getCharacterDetails(String characterKey) throws Exception {
Character character = charactersRepository.getByKey(characterKey);
notifySuccess(character);
}
Aggregations