Skip to content

Instantly share code, notes, and snippets.

Avatar
🤡

Rafael Fernandes Pereira oindiao

🤡
View GitHub Profile
View getSizeOfType.java
public Map<OrderTypeDto, Integer> getSizeOfType() {
HashMap<OrderTypeDto, Integer> map = new HashMap<OrderTypeDto, Integer>();
for (OrderTypeDto dto: OrderTypeDto.values()){
map.put(dto, getListOrderByType(dto).size());
}
return map;
}
View getListOrderByType.java
public List<Order> getListOrderByType(OrderTypeDto type) {
OrderType orderType = OrderTypeDto.get(type);
return orderType.getInterfaceOrderData().get();
}
View OrderTypeDto.java
public enum OrderTypeDto {
TRAVEL ,
PURCHASE ,
PAYMENT ,
TAX ;
public static OrderType get(OrderTypeDto dto){
return OrderType.valueOf(dto.name());
}
View InterfaceOrderManager.java
public interface InterfaceOrderManager {
List<Order> getListOrderByType(OrderTypeDto type);
Map<OrderTypeDto, Integer> getSizeOfType();
}
View InterfaceOrderData.java
public interface InterfaceOrderData {
List<Order> get();
}
View Order.java
public class Order {
private String requester;
private Date dueDate;
private Double value;
// ...
// construtor, get, set, etc
// ...
View DaysOfWeek.java
public enum DaysOfWeek {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY;
}
You can’t perform that action at this time.