diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/App.java b/semaphore/src/main/java/com/iluwatar/semaphore/App.java
index e1f43cf97..ccf3dc4ab 100644
--- a/semaphore/src/main/java/com/iluwatar/semaphore/App.java
+++ b/semaphore/src/main/java/com/iluwatar/semaphore/App.java
@@ -25,18 +25,17 @@ package com.iluwatar.semaphore;
/**
* A Semaphore mediates access by a group of threads to a pool of resources.
- *
- * In this example a group of customers are taking fruit from a fruit shop.
- * There is a bowl each of apples, oranges and lemons. Only one customer can
- * access a bowl simultaneously. A Semaphore is used to indicate how many
- * resources are currently available and must be acquired in order for a bowl
- * to be given to a customer. Customers continually try to take fruit until
- * there is no fruit left in the shop.
+ *
+ *
In this example a group of customers are taking fruit from a fruit shop. There is a bowl each
+ * of apples, oranges and lemons. Only one customer can access a bowl simultaneously. A Semaphore is
+ * used to indicate how many resources are currently available and must be acquired in order for a
+ * bowl to be given to a customer. Customers continually try to take fruit until there is no fruit
+ * left in the shop.
*/
public class App {
-
+
/**
- * main method
+ * main method.
*/
public static void main(String[] args) {
FruitShop shop = new FruitShop();
@@ -47,5 +46,5 @@ public class App {
new Customer("Ringo", shop).start();
new Customer("George", shop).start();
}
-
+
}
diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/Customer.java b/semaphore/src/main/java/com/iluwatar/semaphore/Customer.java
index 4e380f92a..97c9cf0e0 100644
--- a/semaphore/src/main/java/com/iluwatar/semaphore/Customer.java
+++ b/semaphore/src/main/java/com/iluwatar/semaphore/Customer.java
@@ -27,8 +27,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * A Customer attempts to repeatedly take Fruit from the FruitShop by
- * taking Fruit from FruitBowl instances.
+ * A Customer attempts to repeatedly take Fruit from the FruitShop by taking Fruit from FruitBowl
+ * instances.
*/
public class Customer extends Thread {
@@ -38,36 +38,35 @@ public class Customer extends Thread {
* Name of the Customer.
*/
private final String name;
-
+
/**
* The FruitShop he is using.
*/
private final FruitShop fruitShop;
-
+
/**
* Their bowl of Fruit.
*/
private final FruitBowl fruitBowl;
-
+
/**
- * Customer constructor
+ * Customer constructor.
*/
public Customer(String name, FruitShop fruitShop) {
this.name = name;
this.fruitShop = fruitShop;
this.fruitBowl = new FruitBowl();
}
-
+
/**
- * The Customer repeatedly takes Fruit from the FruitShop until no Fruit
- * remains.
- */
+ * The Customer repeatedly takes Fruit from the FruitShop until no Fruit remains.
+ */
public void run() {
-
+
while (fruitShop.countFruit() > 0) {
FruitBowl bowl = fruitShop.takeBowl();
Fruit fruit;
-
+
if (bowl != null && (fruit = bowl.take()) != null) {
LOGGER.info("{} took an {}", name, fruit);
fruitBowl.put(fruit);
@@ -76,7 +75,7 @@ public class Customer extends Thread {
}
LOGGER.info("{} took {}", name, fruitBowl);
-
+
}
-
+
}
diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java b/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java
index 05872be9d..d94764dbe 100644
--- a/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java
+++ b/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java
@@ -29,7 +29,7 @@ package com.iluwatar.semaphore;
public class Fruit {
/**
- * Enumeration of Fruit Types
+ * Enumeration of Fruit Types.
*/
public enum FruitType {
ORANGE, APPLE, LEMON
@@ -46,7 +46,7 @@ public class Fruit {
}
/**
- * toString method
+ * toString method.
*/
public String toString() {
switch (type) {
diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/FruitBowl.java b/semaphore/src/main/java/com/iluwatar/semaphore/FruitBowl.java
index 8696709a0..9089f9c73 100644
--- a/semaphore/src/main/java/com/iluwatar/semaphore/FruitBowl.java
+++ b/semaphore/src/main/java/com/iluwatar/semaphore/FruitBowl.java
@@ -23,19 +23,20 @@
package com.iluwatar.semaphore;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
/**
- * A FruitBowl contains Fruit.
+ * A FruitBowl contains Fruit.
*/
public class FruitBowl {
-
+
private List fruit = new ArrayList<>();
/**
- *
- * @return The amount of Fruit left in the bowl.
+ * Returns the amount of fruits left in bowl.
+ *
+ * @return The amount of Fruit left in the bowl.
*/
public int countFruit() {
return fruit.size();
@@ -43,15 +44,16 @@ public class FruitBowl {
/**
* Put an item of Fruit into the bowl.
- *
+ *
* @param f fruit
*/
public void put(Fruit f) {
fruit.add(f);
}
-
+
/**
* Take an item of Fruit out of the bowl.
+ *
* @return The Fruit taken out of the bowl, or null if empty.
*/
public Fruit take() {
@@ -61,15 +63,15 @@ public class FruitBowl {
return fruit.remove(0);
}
}
-
+
/**
- * toString method
- */
+ * toString method.
+ */
public String toString() {
int apples = 0;
int oranges = 0;
int lemons = 0;
-
+
for (Fruit f : fruit) {
switch (f.getType()) {
case APPLE:
@@ -84,7 +86,7 @@ public class FruitBowl {
default:
}
}
-
+
return apples + " Apples, " + oranges + " Oranges, and " + lemons + " Lemons";
}
}
diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/FruitShop.java b/semaphore/src/main/java/com/iluwatar/semaphore/FruitShop.java
index cd71955fb..ba826fb09 100644
--- a/semaphore/src/main/java/com/iluwatar/semaphore/FruitShop.java
+++ b/semaphore/src/main/java/com/iluwatar/semaphore/FruitShop.java
@@ -27,32 +27,32 @@ package com.iluwatar.semaphore;
* A FruitShop contains three FruitBowl instances and controls access to them.
*/
public class FruitShop {
-
+
/**
* The FruitBowl instances stored in the class.
*/
private FruitBowl[] bowls = {
- new FruitBowl(),
- new FruitBowl(),
- new FruitBowl()
+ new FruitBowl(),
+ new FruitBowl(),
+ new FruitBowl()
};
/**
* Access flags for each of the FruitBowl instances.
*/
private boolean[] available = {
- true,
- true,
- true
+ true,
+ true,
+ true
};
/**
* The Semaphore that controls access to the class resources.
*/
private Semaphore semaphore;
-
+
/**
- * FruitShop constructor
+ * FruitShop constructor.
*/
public FruitShop() {
for (int i = 0; i < 100; i++) {
@@ -60,30 +60,30 @@ public class FruitShop {
bowls[1].put(new Fruit(Fruit.FruitType.ORANGE));
bowls[2].put(new Fruit(Fruit.FruitType.LEMON));
}
-
+
semaphore = new Semaphore(3);
}
/**
- *
+ * Returns the amount of fruits left in shop.
+ *
* @return The amount of Fruit left in the shop.
*/
public synchronized int countFruit() {
return bowls[0].countFruit() + bowls[1].countFruit() + bowls[2].countFruit();
}
-
+
/**
- * Method called by Customer to get a FruitBowl from the shop. This method
- * will try to acquire the Semaphore before returning the first available
- * FruitBowl.
- */
+ * Method called by Customer to get a FruitBowl from the shop. This method will try to acquire the
+ * Semaphore before returning the first available FruitBowl.
+ */
public synchronized FruitBowl takeBowl() {
-
+
FruitBowl bowl = null;
-
+
try {
semaphore.acquire();
-
+
if (available[0]) {
bowl = bowls[0];
available[0] = false;
@@ -94,7 +94,7 @@ public class FruitShop {
bowl = bowls[2];
available[2] = false;
}
-
+
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
@@ -102,20 +102,19 @@ public class FruitShop {
}
return bowl;
}
-
+
/**
- * Method called by a Customer instance to return a FruitBowl to the shop.
- * This method releases the Semaphore, making the FruitBowl available to
- * another Customer.
- */
+ * Method called by a Customer instance to return a FruitBowl to the shop. This method releases
+ * the Semaphore, making the FruitBowl available to another Customer.
+ */
public synchronized void returnBowl(FruitBowl bowl) {
if (bowl == bowls[0]) {
available[0] = true;
} else if (bowl == bowls[1]) {
available[1] = true;
} else if (bowl == bowls[2]) {
- available [2] = true;
+ available[2] = true;
}
}
-
+
}
diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/Lock.java b/semaphore/src/main/java/com/iluwatar/semaphore/Lock.java
index df7df2cf0..5679e2a05 100644
--- a/semaphore/src/main/java/com/iluwatar/semaphore/Lock.java
+++ b/semaphore/src/main/java/com/iluwatar/semaphore/Lock.java
@@ -27,9 +27,9 @@ package com.iluwatar.semaphore;
* Lock is an interface for a lock which can be acquired and released.
*/
public interface Lock {
-
+
void acquire() throws InterruptedException;
-
+
void release();
-
+
}
diff --git a/semaphore/src/main/java/com/iluwatar/semaphore/Semaphore.java b/semaphore/src/main/java/com/iluwatar/semaphore/Semaphore.java
index 9dfe79316..48b008fdd 100644
--- a/semaphore/src/main/java/com/iluwatar/semaphore/Semaphore.java
+++ b/semaphore/src/main/java/com/iluwatar/semaphore/Semaphore.java
@@ -33,30 +33,29 @@ public class Semaphore implements Lock {
* The number of concurrent resource accesses which are allowed.
*/
private int counter;
-
+
public Semaphore(int licenses) {
this.licenses = licenses;
- this.counter = licenses;
+ this.counter = licenses;
}
-
+
/**
- * Returns the number of licenses managed by the Semaphore
+ * Returns the number of licenses managed by the Semaphore.
*/
public int getNumLicenses() {
return licenses;
}
-
+
/**
- * Returns the number of available licenses
+ * Returns the number of available licenses.
*/
public int getAvailableLicenses() {
- return counter;
+ return counter;
}
-
+
/**
- * Method called by a thread to acquire the lock. If there are no resources
- * available this will wait until the lock has been released to re-attempt
- * the acquire.
+ * Method called by a thread to acquire the lock. If there are no resources available this will
+ * wait until the lock has been released to re-attempt the acquire.
*/
public synchronized void acquire() throws InterruptedException {
while (counter == 0) {
@@ -64,7 +63,7 @@ public class Semaphore implements Lock {
}
counter = counter - 1;
}
-
+
/**
* Method called by a thread to release the lock.
*/
diff --git a/servant/src/main/java/com/iluwatar/servant/App.java b/servant/src/main/java/com/iluwatar/servant/App.java
index 35a26dbcc..fcebec5bf 100644
--- a/servant/src/main/java/com/iluwatar/servant/App.java
+++ b/servant/src/main/java/com/iluwatar/servant/App.java
@@ -23,29 +23,27 @@
package com.iluwatar.servant;
+import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.List;
-
/**
* Servant offers some functionality to a group of classes without defining that functionality in
* each of them. A Servant is a class whose instance provides methods that take care of a desired
* service, while objects for which the servant does something, are taken as parameters.
- *
- * In this example {@link Servant} is serving {@link King} and {@link Queen}.
*
+ *
In this example {@link Servant} is serving {@link King} and {@link Queen}.
*/
public class App {
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
- static Servant jenkins = new Servant("Jenkins");
- static Servant travis = new Servant("Travis");
+ private static Servant jenkins = new Servant("Jenkins");
+ private static Servant travis = new Servant("Travis");
/**
- * Program entry point
+ * Program entry point.
*/
public static void main(String[] args) {
scenario(jenkins, 1);
@@ -53,7 +51,7 @@ public class App {
}
/**
- * Can add a List with enum Actions for variable scenarios
+ * Can add a List with enum Actions for variable scenarios.
*/
public static void scenario(Servant servant, int compliment) {
King k = new King();
diff --git a/servant/src/main/java/com/iluwatar/servant/King.java b/servant/src/main/java/com/iluwatar/servant/King.java
index 19db41201..1017ef378 100644
--- a/servant/src/main/java/com/iluwatar/servant/King.java
+++ b/servant/src/main/java/com/iluwatar/servant/King.java
@@ -24,9 +24,7 @@
package com.iluwatar.servant;
/**
- *
- * King
- *
+ * King.
*/
public class King implements Royalty {
diff --git a/servant/src/main/java/com/iluwatar/servant/Queen.java b/servant/src/main/java/com/iluwatar/servant/Queen.java
index 3e4fa486f..416efaade 100644
--- a/servant/src/main/java/com/iluwatar/servant/Queen.java
+++ b/servant/src/main/java/com/iluwatar/servant/Queen.java
@@ -24,9 +24,7 @@
package com.iluwatar.servant;
/**
- *
- * Queen
- *
+ * Queen.
*/
public class Queen implements Royalty {
diff --git a/servant/src/main/java/com/iluwatar/servant/Royalty.java b/servant/src/main/java/com/iluwatar/servant/Royalty.java
index 88c301ffe..959d108f0 100644
--- a/servant/src/main/java/com/iluwatar/servant/Royalty.java
+++ b/servant/src/main/java/com/iluwatar/servant/Royalty.java
@@ -24,9 +24,7 @@
package com.iluwatar.servant;
/**
- *
- * Royalty
- *
+ * Royalty.
*/
interface Royalty {
diff --git a/servant/src/main/java/com/iluwatar/servant/Servant.java b/servant/src/main/java/com/iluwatar/servant/Servant.java
index 97d6107c4..856f7806b 100644
--- a/servant/src/main/java/com/iluwatar/servant/Servant.java
+++ b/servant/src/main/java/com/iluwatar/servant/Servant.java
@@ -26,16 +26,14 @@ package com.iluwatar.servant;
import java.util.List;
/**
- *
- * Servant
- *
+ * Servant.
*/
public class Servant {
public String name;
/**
- * Constructor
+ * Constructor.
*/
public Servant(String name) {
this.name = name;
@@ -54,7 +52,7 @@ public class Servant {
}
/**
- * Check if we will be hanged
+ * Check if we will be hanged.
*/
public boolean checkIfYouWillBeHanged(List tableGuests) {
boolean anotherDay = true;
diff --git a/serverless/src/main/java/com/iluwatar/serverless/baas/api/AbstractDynamoDbHandler.java b/serverless/src/main/java/com/iluwatar/serverless/baas/api/AbstractDynamoDbHandler.java
index eff21f879..43465f529 100644
--- a/serverless/src/main/java/com/iluwatar/serverless/baas/api/AbstractDynamoDbHandler.java
+++ b/serverless/src/main/java/com/iluwatar/serverless/baas/api/AbstractDynamoDbHandler.java
@@ -30,13 +30,13 @@ import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
- * abstract dynamodb handler
+ * abstract dynamodb handler.
+ *
* @param - serializable collection
*/
public abstract class AbstractDynamoDbHandler {
@@ -78,10 +78,10 @@ public abstract class AbstractDynamoDbHandler {
}
/**
- * API Gateway response
+ * API Gateway response.
*
* @param statusCode - status code
- * @param body - Object body
+ * @param body - Object body
* @return - api gateway proxy response
*/
protected APIGatewayProxyResponseEvent apiGatewayProxyResponseEvent(Integer statusCode, T body) {
diff --git a/serverless/src/main/java/com/iluwatar/serverless/baas/api/FindPersonApiHandler.java b/serverless/src/main/java/com/iluwatar/serverless/baas/api/FindPersonApiHandler.java
index 3e0bde023..11066c744 100644
--- a/serverless/src/main/java/com/iluwatar/serverless/baas/api/FindPersonApiHandler.java
+++ b/serverless/src/main/java/com/iluwatar/serverless/baas/api/FindPersonApiHandler.java
@@ -28,14 +28,12 @@ import com.amazonaws.services.lambda.runtime.RequestHandler;
import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent;
import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent;
import com.iluwatar.serverless.baas.model.Person;
+import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Map;
-
/**
- * find person from persons collection
- * Created by dheeraj.mummar on 3/5/18.
+ * find person from persons collection Created by dheeraj.mummar on 3/5/18.
*/
public class FindPersonApiHandler extends AbstractDynamoDbHandler
implements RequestHandler {
@@ -44,10 +42,11 @@ public class FindPersonApiHandler extends AbstractDynamoDbHandler
private static final Integer SUCCESS_STATUS_CODE = 200;
@Override
- public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent apiGatewayProxyRequestEvent,
- Context context) {
+ public APIGatewayProxyResponseEvent handleRequest(
+ APIGatewayProxyRequestEvent apiGatewayProxyRequestEvent, Context context) {
Map pathParameters = apiGatewayProxyRequestEvent.getPathParameters();
- pathParameters.keySet().stream().map(key -> key + "=" + pathParameters.get(key)).forEach(LOG::info);
+ pathParameters.keySet().stream().map(key -> key + "=" + pathParameters.get(key))
+ .forEach(LOG::info);
Person person = this.getDynamoDbMapper().load(Person.class, apiGatewayProxyRequestEvent
.getPathParameters().get("id"));
diff --git a/serverless/src/main/java/com/iluwatar/serverless/baas/api/SavePersonApiHandler.java b/serverless/src/main/java/com/iluwatar/serverless/baas/api/SavePersonApiHandler.java
index 502f12258..0bc121853 100644
--- a/serverless/src/main/java/com/iluwatar/serverless/baas/api/SavePersonApiHandler.java
+++ b/serverless/src/main/java/com/iluwatar/serverless/baas/api/SavePersonApiHandler.java
@@ -28,14 +28,12 @@ import com.amazonaws.services.lambda.runtime.RequestHandler;
import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent;
import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent;
import com.iluwatar.serverless.baas.model.Person;
+import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.IOException;
-
/**
- * save person into persons collection
- * Created by dheeraj.mummar on 3/4/18.
+ * save person into persons collection Created by dheeraj.mummar on 3/4/18.
*/
public class SavePersonApiHandler extends AbstractDynamoDbHandler
implements RequestHandler {
@@ -45,8 +43,8 @@ public class SavePersonApiHandler extends AbstractDynamoDbHandler
private static final Integer BAD_REQUEST_STATUS_CODE = 400;
@Override
- public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent
- apiGatewayProxyRequestEvent, Context context) {
+ public APIGatewayProxyResponseEvent handleRequest(
+ APIGatewayProxyRequestEvent apiGatewayProxyRequestEvent, Context context) {
APIGatewayProxyResponseEvent apiGatewayProxyResponseEvent;
Person person;
try {
diff --git a/serverless/src/main/java/com/iluwatar/serverless/baas/model/Address.java b/serverless/src/main/java/com/iluwatar/serverless/baas/model/Address.java
index c2e8fdac6..710cde531 100644
--- a/serverless/src/main/java/com/iluwatar/serverless/baas/model/Address.java
+++ b/serverless/src/main/java/com/iluwatar/serverless/baas/model/Address.java
@@ -25,12 +25,10 @@ package com.iluwatar.serverless.baas.model;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBDocument;
-
import java.io.Serializable;
/**
- * Address class
- * Created by dheeraj.mummarareddy on 3/4/18.
+ * Address class Created by dheeraj.mummarareddy on 3/4/18.
*/
@DynamoDBDocument
public class Address implements Serializable {
diff --git a/serverless/src/main/java/com/iluwatar/serverless/baas/model/Person.java b/serverless/src/main/java/com/iluwatar/serverless/baas/model/Person.java
index cf8a30d3f..3c97aae11 100644
--- a/serverless/src/main/java/com/iluwatar/serverless/baas/model/Person.java
+++ b/serverless/src/main/java/com/iluwatar/serverless/baas/model/Person.java
@@ -28,12 +28,10 @@ import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;
import com.fasterxml.jackson.annotation.JsonProperty;
-
import java.io.Serializable;
/**
- * Person class
- * Created by dheeraj.mummarareddy on 3/4/18.
+ * Person class Created by dheeraj.mummarareddy on 3/4/18.
*/
@DynamoDBTable(tableName = "persons")
public class Person implements Serializable {
diff --git a/serverless/src/main/java/com/iluwatar/serverless/faas/ApiGatewayResponse.java b/serverless/src/main/java/com/iluwatar/serverless/faas/ApiGatewayResponse.java
index 8de042161..94fe7b4f9 100644
--- a/serverless/src/main/java/com/iluwatar/serverless/faas/ApiGatewayResponse.java
+++ b/serverless/src/main/java/com/iluwatar/serverless/faas/ApiGatewayResponse.java
@@ -25,12 +25,11 @@ package com.iluwatar.serverless.faas;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-
import java.io.Serializable;
import java.util.Map;
/**
- * Api gateway response
+ * Api gateway response.
*
* @param serializable object
*/
@@ -44,11 +43,11 @@ public class ApiGatewayResponse implements Serializable
private final Boolean isBase64Encoded;
/**
- * api gateway response
+ * api gateway response.
*
- * @param statusCode - http status code
- * @param body - response body
- * @param headers - response headers
+ * @param statusCode - http status code
+ * @param body - response body
+ * @param headers - response headers
* @param isBase64Encoded - base64Encoded flag
*/
public ApiGatewayResponse(Integer statusCode, String body, Map headers,
@@ -60,7 +59,7 @@ public class ApiGatewayResponse implements Serializable
}
/**
- * http status code
+ * http status code.
*
* @return statusCode - http status code
*/
@@ -69,7 +68,7 @@ public class ApiGatewayResponse implements Serializable
}
/**
- * response body
+ * response body.
*
* @return string body
*/
@@ -78,7 +77,7 @@ public class ApiGatewayResponse implements Serializable
}
/**
- * response headers
+ * response headers.
*
* @return response headers
*/
@@ -87,7 +86,7 @@ public class ApiGatewayResponse implements Serializable
}
/**
- * base64Encoded flag, API Gateway expects the property to be called "isBase64Encoded"
+ * base64Encoded flag, API Gateway expects the property to be called "isBase64Encoded".
*
* @return base64Encoded flag
*/
@@ -96,7 +95,8 @@ public class ApiGatewayResponse implements Serializable
}
/**
- * ApiGatewayResponse Builder class
+ * ApiGatewayResponse Builder class.
+ *
* @param Serializable object
*/
public static class ApiGatewayResponseBuilder {
@@ -107,7 +107,8 @@ public class ApiGatewayResponse implements Serializable
private Boolean isBase64Encoded;
/**
- * http status code
+ * http status code.
+ *
* @param statusCode - http status code
* @return ApiGatewayResponseBuilder
*/
@@ -117,7 +118,8 @@ public class ApiGatewayResponse implements Serializable
}
/**
- * Serializable body
+ * Serializable body.
+ *
* @param body - Serializable object
* @return ApiGatewayResponseBuilder
*/
@@ -127,7 +129,8 @@ public class ApiGatewayResponse implements Serializable
}
/**
- * response headers
+ * response headers.
+ *
* @param headers - response headers
* @return ApiGatewayResponseBuilder
*/
@@ -137,7 +140,8 @@ public class ApiGatewayResponse implements Serializable
}
/**
- * base64Encoded glag
+ * base64Encoded flag.
+ *
* @param isBase64Encoded - base64Encoded flag
* @return ApiGatewayResponseBuilder
*/
@@ -147,7 +151,7 @@ public class ApiGatewayResponse implements Serializable
}
/**
- * build ApiGatewayResponse
+ * build ApiGatewayResponse.
*
* @return ApiGatewayResponse
*/
diff --git a/serverless/src/main/java/com/iluwatar/serverless/faas/LambdaInfo.java b/serverless/src/main/java/com/iluwatar/serverless/faas/LambdaInfo.java
index 8fec38457..7cb93ebf4 100644
--- a/serverless/src/main/java/com/iluwatar/serverless/faas/LambdaInfo.java
+++ b/serverless/src/main/java/com/iluwatar/serverless/faas/LambdaInfo.java
@@ -26,7 +26,7 @@ package com.iluwatar.serverless.faas;
import java.io.Serializable;
/**
- * Lambda context information
+ * Lambda context information.
*/
public class LambdaInfo implements Serializable {
@@ -110,22 +110,28 @@ public class LambdaInfo implements Serializable {
LambdaInfo that = (LambdaInfo) o;
- if (awsRequestId != null ? !awsRequestId.equals(that.awsRequestId) : that.awsRequestId != null) {
+ if (awsRequestId != null ? !awsRequestId
+ .equals(that.awsRequestId) : that.awsRequestId != null) {
return false;
}
- if (logGroupName != null ? !logGroupName.equals(that.logGroupName) : that.logGroupName != null) {
+ if (logGroupName != null ? !logGroupName
+ .equals(that.logGroupName) : that.logGroupName != null) {
return false;
}
- if (logStreamName != null ? !logStreamName.equals(that.logStreamName) : that.logStreamName != null) {
+ if (logStreamName != null ? !logStreamName
+ .equals(that.logStreamName) : that.logStreamName != null) {
return false;
}
- if (functionName != null ? !functionName.equals(that.functionName) : that.functionName != null) {
+ if (functionName != null ? !functionName
+ .equals(that.functionName) : that.functionName != null) {
return false;
}
- if (functionVersion != null ? !functionVersion.equals(that.functionVersion) : that.functionVersion != null) {
+ if (functionVersion != null ? !functionVersion
+ .equals(that.functionVersion) : that.functionVersion != null) {
return false;
}
- return memoryLimitInMb != null ? memoryLimitInMb.equals(that.memoryLimitInMb) : that.memoryLimitInMb == null;
+ return memoryLimitInMb != null ? memoryLimitInMb
+ .equals(that.memoryLimitInMb) : that.memoryLimitInMb == null;
}
@Override
diff --git a/serverless/src/main/java/com/iluwatar/serverless/faas/api/LambdaInfoApiHandler.java b/serverless/src/main/java/com/iluwatar/serverless/faas/api/LambdaInfoApiHandler.java
index 62b73ee57..a16358a54 100644
--- a/serverless/src/main/java/com/iluwatar/serverless/faas/api/LambdaInfoApiHandler.java
+++ b/serverless/src/main/java/com/iluwatar/serverless/faas/api/LambdaInfoApiHandler.java
@@ -23,22 +23,20 @@
package com.iluwatar.serverless.faas.api;
-import com.iluwatar.serverless.faas.ApiGatewayResponse;
-
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
+import com.iluwatar.serverless.faas.ApiGatewayResponse;
import com.iluwatar.serverless.faas.LambdaInfo;
+import java.util.HashMap;
+import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.HashMap;
-import java.util.Map;
-
/**
- * LambdaInfoApiHandler - simple api to get lambda context
- * Created by dheeraj.mummar on 2/5/18.
+ * LambdaInfoApiHandler - simple api to get lambda context Created by dheeraj.mummar on 2/5/18.
*/
-public class LambdaInfoApiHandler implements RequestHandler