Java 11 migrate remaining q-r (#1121)

* Moves queue-load-leveling to Java 11

* Moves reactor to Java 11

* Moves reader-writer-lock to Java 11

* Moves repository to Java 11

* Moves resource-acquisition-is-initialization to Java 11

* Moves retry to Java 11

* Moves role-object to Java 11
This commit is contained in:
Anurag Agarwal
2020-01-04 22:13:12 +05:30
committed by Ilkka Seppälä
parent cd2a2e7711
commit 20ea465b7f
52 changed files with 424 additions and 554 deletions
@@ -23,6 +23,7 @@
package com.iluwatar.roleobject;
import java.util.Arrays;
import java.util.Optional;
/**
@@ -32,6 +33,7 @@ public abstract class Customer {
/**
* Add specific role @see {@link Role}.
*
* @param role to add
* @return true if the operation has been successful otherwise false
*/
@@ -39,6 +41,7 @@ public abstract class Customer {
/**
* Check specific role @see {@link Role}.
*
* @param role to check
* @return true if the role exists otherwise false
*/
@@ -47,6 +50,7 @@ public abstract class Customer {
/**
* Remove specific role @see {@link Role}.
*
* @param role to remove
* @return true if the operation has been successful otherwise false
*/
@@ -54,6 +58,7 @@ public abstract class Customer {
/**
* Get specific instance associated with this role @see {@link Role}.
*
* @param role to get
* @param expectedRole instance class expected to get
* @return optional with value if the instance exists and corresponds expected class
@@ -67,14 +72,13 @@ public abstract class Customer {
/**
* Create {@link Customer} with given roles.
*
* @param role roles
* @return Customer
*/
public static Customer newCustomer(Role... role) {
Customer customer = newCustomer();
for (Role r : role) {
customer.addRole(r);
}
var customer = newCustomer();
Arrays.stream(role).forEach(customer::addRole);
return customer;
}