mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 18:59:10 +00:00
deps: Refactor dependencies (#3224)
* remove spring dep move junit, logging, mockito under dep mgmt * upgrade anti-corruption-layer deps * async method invocation * balking, bloc * bridge to bytecode * caching * callback - cqrs * component - health check * hexagonal - metadata mapping * rest of the patterns * remove checkstyle, take spotless into use
This commit is contained in:
@@ -27,9 +27,7 @@ package com.iluwatar.roleobject;
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* The main abstraction to work with Customer.
|
||||
*/
|
||||
/** The main abstraction to work with Customer. */
|
||||
public abstract class Customer {
|
||||
|
||||
/**
|
||||
@@ -46,7 +44,6 @@ public abstract class Customer {
|
||||
* @param role to check
|
||||
* @return true if the role exists otherwise false
|
||||
*/
|
||||
|
||||
public abstract boolean hasRole(Role role);
|
||||
|
||||
/**
|
||||
@@ -60,13 +57,12 @@ public abstract class Customer {
|
||||
/**
|
||||
* Get specific instance associated with this role @see {@link Role}.
|
||||
*
|
||||
* @param role to get
|
||||
* @param role to get
|
||||
* @param expectedRole instance class expected to get
|
||||
* @return optional with value if the instance exists and corresponds expected class
|
||||
*/
|
||||
public abstract <T extends Customer> Optional<T> getRole(Role role, Class<T> expectedRole);
|
||||
|
||||
|
||||
public static Customer newCustomer() {
|
||||
return new CustomerCore();
|
||||
}
|
||||
@@ -82,5 +78,4 @@ public abstract class Customer {
|
||||
Arrays.stream(role).forEach(customer::addRole);
|
||||
return customer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user