Skip to content

Commit f81e57c

Browse files
committed
update checkstyle
1 parent 1524930 commit f81e57c

File tree

4 files changed

+201
-165
lines changed

4 files changed

+201
-165
lines changed

examples/src/main/java/com/expediagroup/sdk/rapid/examples/RapidSdkDemoApplication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public static void main(String[] args) throws ExecutionException, InterruptedExc
179179
logger.info(
180180
"========================== End of Property Content Scenarios ===========================");
181181

182-
logger.info("============================ Running Ad Delivery Scenarios =============================");
182+
logger.info("======================== Running Ad Delivery Scenarios =========================");
183183

184184
/* Run Get Ads Scenario using the default profile
185185
This scenario demonstrates the following:
@@ -191,7 +191,7 @@ public static void main(String[] args) throws ExecutionException, InterruptedExc
191191
getAdsScenario.setProfile(new DefaultRapidPartnerProfile());
192192
getAdsScenario.run();
193193

194-
logger.info("=========================== End of Ad Delivery Scenarios ============================");
194+
logger.info("=========================== End of Ad Delivery Scenarios ======================");
195195

196196
logger.info(
197197
"=======================================================================================");

examples/src/main/java/com/expediagroup/sdk/rapid/examples/RapidSdkGeographyDemoApp.java

Lines changed: 116 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -9,110 +9,125 @@
99
import com.expediagroup.sdk.rapid.examples.scenarios.geography.ParseRegionCoordinatesScenario;
1010
import com.expediagroup.sdk.rapid.examples.scenarios.geography.ParseRegionDescendantsScenario;
1111
import com.expediagroup.sdk.rapid.examples.scenarios.geography.ParseRegionWithMultiPolygonCoordinatesScenario;
12+
import java.util.concurrent.ExecutionException;
1213
import org.slf4j.Logger;
1314
import org.slf4j.LoggerFactory;
1415

15-
import java.util.concurrent.ExecutionException;
16-
17-
16+
/**
17+
* This is the main class for the Rapid SDK Geography demonstration.
18+
*/
1819
public class RapidSdkGeographyDemoApp {
1920

20-
private static final Logger logger = LoggerFactory.getLogger(RapidSdkGeographyDemoApp.class);
21-
22-
public static void main(String[] args) throws ExecutionException, InterruptedException {
23-
24-
logger.info("=======================================================================================");
25-
logger.info("=======================================================================================");
26-
logger.info("== ==");
27-
logger.info("== Howdy! This is a demonstration of Expedia Group RAPID SDK Geography, Enjoy! ==");
28-
logger.info("== ==");
29-
logger.info("=======================================================================================");
30-
logger.info("=======================================================================================");
31-
32-
logger.info("=============================== Running Geography Scenarios ===========================");
33-
34-
/* Run Get List of Region Names Scenario using the default profile
35-
This scenario demonstrates the following:
36-
1. Getting all regions with details in a paginated manner
37-
2. Filtering region names
38-
*/
39-
GetListOfRegionNamesScenario getListOfRegionNamesScenario = new GetListOfRegionNamesScenario();
40-
getListOfRegionNamesScenario.setProfile(new DefaultRapidPartnerProfile());
41-
getListOfRegionNamesScenario.run();
42-
43-
/* Run Get Region Name of Region Scenario using the default profile
44-
This scenario demonstrates the following:
45-
1. Getting region details by region id
46-
2. Accessing region details
47-
*/
48-
GetRegionDetailsAndPropertyIdsScenario getRegionNameOfRegionScenario = new GetRegionDetailsAndPropertyIdsScenario();
49-
getRegionNameOfRegionScenario.setProfile(new DefaultRapidPartnerProfile());
50-
getRegionNameOfRegionScenario.run();
51-
52-
/* Run Get Region By Ancestor Id Scenario using the default profile
53-
This scenario demonstrates the following:
54-
1. Getting paginated regions details by ancestor id
55-
2. Accessing region details
56-
*/
57-
GetRegionByAncestorIdScenario getRegionByAncestorIdScenario = new GetRegionByAncestorIdScenario();
58-
getRegionByAncestorIdScenario.setProfile(new DefaultRapidPartnerProfile());
59-
getRegionByAncestorIdScenario.run();
60-
61-
/* Run Get Region With MultiPolygon Coordinates Scenario using the default profile
62-
This scenario demonstrates the following:
63-
1. Getting region details with multipolygon coordinates by region id
64-
2. Accessing region coordinates of type multipolygon
65-
3. Accessing every polygon list of coordinates.
66-
*/
67-
ParseRegionWithMultiPolygonCoordinatesScenario parseRegionWithMultiPolygonCoordinatesScenario = new ParseRegionWithMultiPolygonCoordinatesScenario();
68-
parseRegionWithMultiPolygonCoordinatesScenario.setProfile(new DefaultRapidPartnerProfile());
69-
parseRegionWithMultiPolygonCoordinatesScenario.run();
70-
71-
/* Run Parse Region Ancestors Scenario using the default profile
72-
This scenario demonstrates the following:
73-
1. Getting region details with ancestors by region id
74-
2. Parsing region ancestors
75-
*/
76-
ParseRegionAncestorsScenario parseRegionAncestorsScenario = new ParseRegionAncestorsScenario();
77-
parseRegionAncestorsScenario.setProfile(new DefaultRapidPartnerProfile());
78-
parseRegionAncestorsScenario.run();
79-
80-
/* Run Parse Region Descendants Scenario using the default profile
81-
This scenario demonstrates the following:
82-
1. Getting region details with descendants by region id
83-
2. Parsing region descendants
84-
*/
85-
ParseRegionDescendantsScenario parseRegionDescendantsScenario = new ParseRegionDescendantsScenario();
86-
parseRegionDescendantsScenario.setProfile(new DefaultRapidPartnerProfile());
87-
parseRegionDescendantsScenario.run();
88-
89-
/* Run Parse Region Coordinates Scenario using the default profile
90-
This scenario demonstrates the following:
91-
1. Getting region details with coordinates by region id
92-
2. Parsing region coordinates
93-
*/
94-
ParseRegionCoordinatesScenario parseRegionCoordinatesScenario = new ParseRegionCoordinatesScenario();
95-
parseRegionCoordinatesScenario.setProfile(new DefaultRapidPartnerProfile());
96-
parseRegionCoordinatesScenario.run();
97-
98-
/* Run Parse Region Categories Scenario using the default profile
99-
This scenario demonstrates the following:
100-
1. Getting region details with property ids by region id
101-
2. Parsing region categories
102-
*/
103-
ParseRegionCategoriesScenario parseRegionCategoriesScenario = new ParseRegionCategoriesScenario();
104-
parseRegionCategoriesScenario.setProfile(new DefaultRapidPartnerProfile());
105-
parseRegionCategoriesScenario.run();
106-
107-
logger.info("=============================== End of Geography Scenarios ===========================");
108-
109-
logger.info("=======================================================================================");
110-
logger.info("=======================================================================================");
111-
logger.info("== ==");
112-
logger.info("== That's all folks! That was the demonstration of RAPID SDK Geography. ==");
113-
logger.info("== ==");
114-
logger.info("=======================================================================================");
115-
logger.info("=======================================================================================");
116-
System.exit(0);
117-
}
21+
private static final Logger logger = LoggerFactory.getLogger(RapidSdkGeographyDemoApp.class);
22+
23+
/**
24+
* Main method to run the Rapid SDK Geography demonstration.
25+
*
26+
* @param args the arguments
27+
* @throws ExecutionException the execution exception
28+
* @throws InterruptedException the interrupted exception
29+
*/
30+
public static void main(String[] args) throws ExecutionException, InterruptedException {
31+
32+
logger.info("================================================================================");
33+
logger.info("================================================================================");
34+
logger.info("== ==");
35+
logger.info(
36+
"== Howdy! This is a demonstration of Expedia Group RAPID SDK Geography, Enjoy! ==");
37+
logger.info("== ==");
38+
logger.info("================================================================================");
39+
logger.info("================================================================================");
40+
41+
logger.info("============================ Running Geography Scenarios =======================");
42+
43+
/* Run Get List of Region Names Scenario using the default profile
44+
This scenario demonstrates the following:
45+
1. Getting all regions with details in a paginated manner
46+
2. Filtering region names
47+
*/
48+
GetListOfRegionNamesScenario getListOfRegionNamesScenario = new GetListOfRegionNamesScenario();
49+
getListOfRegionNamesScenario.setProfile(new DefaultRapidPartnerProfile());
50+
getListOfRegionNamesScenario.run();
51+
52+
/* Run Get Region Name of Region Scenario using the default profile
53+
This scenario demonstrates the following:
54+
1. Getting region details by region id
55+
2. Accessing region details
56+
*/
57+
GetRegionDetailsAndPropertyIdsScenario getRegionNameOfRegionScenario =
58+
new GetRegionDetailsAndPropertyIdsScenario();
59+
getRegionNameOfRegionScenario.setProfile(new DefaultRapidPartnerProfile());
60+
getRegionNameOfRegionScenario.run();
61+
62+
/* Run Get Region By Ancestor Id Scenario using the default profile
63+
This scenario demonstrates the following:
64+
1. Getting paginated regions details by ancestor id
65+
2. Accessing region details
66+
*/
67+
GetRegionByAncestorIdScenario getRegionByAncestorIdScenario =
68+
new GetRegionByAncestorIdScenario();
69+
getRegionByAncestorIdScenario.setProfile(new DefaultRapidPartnerProfile());
70+
getRegionByAncestorIdScenario.run();
71+
72+
/* Run Get Region With MultiPolygon Coordinates Scenario using the default profile
73+
This scenario demonstrates the following:
74+
1. Getting region details with multipolygon coordinates by region id
75+
2. Accessing region coordinates of type multipolygon
76+
3. Accessing every polygon list of coordinates.
77+
*/
78+
ParseRegionWithMultiPolygonCoordinatesScenario parseRegionWithMultiPolygonCoordinatesScenario =
79+
new ParseRegionWithMultiPolygonCoordinatesScenario();
80+
parseRegionWithMultiPolygonCoordinatesScenario.setProfile(new DefaultRapidPartnerProfile());
81+
parseRegionWithMultiPolygonCoordinatesScenario.run();
82+
83+
/* Run Parse Region Ancestors Scenario using the default profile
84+
This scenario demonstrates the following:
85+
1. Getting region details with ancestors by region id
86+
2. Parsing region ancestors
87+
*/
88+
ParseRegionAncestorsScenario parseRegionAncestorsScenario = new ParseRegionAncestorsScenario();
89+
parseRegionAncestorsScenario.setProfile(new DefaultRapidPartnerProfile());
90+
parseRegionAncestorsScenario.run();
91+
92+
/* Run Parse Region Descendants Scenario using the default profile
93+
This scenario demonstrates the following:
94+
1. Getting region details with descendants by region id
95+
2. Parsing region descendants
96+
*/
97+
ParseRegionDescendantsScenario parseRegionDescendantsScenario =
98+
new ParseRegionDescendantsScenario();
99+
parseRegionDescendantsScenario.setProfile(new DefaultRapidPartnerProfile());
100+
parseRegionDescendantsScenario.run();
101+
102+
/* Run Parse Region Coordinates Scenario using the default profile
103+
This scenario demonstrates the following:
104+
1. Getting region details with coordinates by region id
105+
2. Parsing region coordinates
106+
*/
107+
ParseRegionCoordinatesScenario parseRegionCoordinatesScenario =
108+
new ParseRegionCoordinatesScenario();
109+
parseRegionCoordinatesScenario.setProfile(new DefaultRapidPartnerProfile());
110+
parseRegionCoordinatesScenario.run();
111+
112+
/* Run Parse Region Categories Scenario using the default profile
113+
This scenario demonstrates the following:
114+
1. Getting region details with property ids by region id
115+
2. Parsing region categories
116+
*/
117+
ParseRegionCategoriesScenario parseRegionCategoriesScenario =
118+
new ParseRegionCategoriesScenario();
119+
parseRegionCategoriesScenario.setProfile(new DefaultRapidPartnerProfile());
120+
parseRegionCategoriesScenario.run();
121+
122+
logger.info("============================ End of Geography Scenarios ========================");
123+
124+
logger.info("================================================================================");
125+
logger.info("================================================================================");
126+
logger.info("== ==");
127+
logger.info("== That's all folks! That was the demonstration of RAPID SDK Geography. ==");
128+
logger.info("== ==");
129+
logger.info("================================================================================");
130+
logger.info("================================================================================");
131+
System.exit(0);
132+
}
118133
}

examples/src/main/java/com/expediagroup/sdk/rapid/examples/scenarios/addelivery/GetAdsScenario.java

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,62 @@
44
import com.expediagroup.sdk.rapid.examples.Constants;
55
import com.expediagroup.sdk.rapid.examples.salesprofiles.RapidPartnerSalesProfile;
66
import com.expediagroup.sdk.rapid.examples.scenarios.RapidScenario;
7-
import com.expediagroup.sdk.rapid.examples.services.ShopService;
87
import com.expediagroup.sdk.rapid.examples.services.AdDeliveryService;
8+
import com.expediagroup.sdk.rapid.examples.services.ShopService;
99
import com.expediagroup.sdk.rapid.models.AdsResponse;
1010
import com.expediagroup.sdk.rapid.models.Property;
11-
import org.slf4j.Logger;
12-
import org.slf4j.LoggerFactory;
13-
1411
import java.util.ArrayList;
1512
import java.util.Arrays;
1613
import java.util.List;
14+
import org.slf4j.Logger;
15+
import org.slf4j.LoggerFactory;
1716

17+
/**
18+
* This scenario demonstrates the GetAds operation.
19+
*/
1820
public class GetAdsScenario implements RapidScenario {
1921

20-
private static final Logger logger = LoggerFactory.getLogger(GetAdsScenario.class);
21-
private AdDeliveryService adDeliveryService = new AdDeliveryService();
22-
private ShopService shopService = new ShopService();
23-
private RapidPartnerSalesProfile rapidPartnerSalesProfile;
22+
private static final Logger logger = LoggerFactory.getLogger(GetAdsScenario.class);
23+
private AdDeliveryService adDeliveryService = new AdDeliveryService();
24+
private ShopService shopService = new ShopService();
25+
private RapidPartnerSalesProfile rapidPartnerSalesProfile;
2426

25-
@Override
26-
public void setProfile(RapidPartnerSalesProfile rapidPartnerSalesProfile) {
27-
this.rapidPartnerSalesProfile = rapidPartnerSalesProfile;
28-
}
27+
/**
28+
* Sets the profile.
29+
*
30+
* @param rapidPartnerSalesProfile the profile
31+
*/
32+
@Override
33+
public void setProfile(RapidPartnerSalesProfile rapidPartnerSalesProfile) {
34+
this.rapidPartnerSalesProfile = rapidPartnerSalesProfile;
35+
}
2936

30-
@Override
31-
public void run() {
37+
@Override
38+
public void run() {
3239

33-
logger.info("Running Get Lodging Ads...");
40+
logger.info("Running Get Lodging Ads...");
3441

35-
// Shopping for properties
36-
logger.info("Getting property availability for test property: {}", Constants.TEST_PROPERTY_ID);
42+
// Shopping for properties
43+
logger.info("Getting property availability for test property: {}", Constants.TEST_PROPERTY_ID);
3744

38-
List<Property> propertyAvailabilityList = shopService.getPropertiesAvailability(Arrays.asList("2"), this.rapidPartnerSalesProfile).getData();
45+
List<Property> propertyAvailabilityList = shopService.getPropertiesAvailability(
46+
Arrays.asList("2"), this.rapidPartnerSalesProfile).getData();
3947

40-
if (propertyAvailabilityList == null || propertyAvailabilityList.isEmpty()) {
41-
throw new IllegalStateException("No property availability found for the test property.");
42-
}
48+
if (propertyAvailabilityList == null || propertyAvailabilityList.isEmpty()) {
49+
throw new IllegalStateException("No property availability found for the test property.");
50+
}
4351

44-
// Get the property ids from response
45-
ArrayList<String> propertyIds = new ArrayList<>();
46-
propertyAvailabilityList.forEach(property -> propertyIds.add(property.getPropertyId()));
52+
// Get the property ids from response
53+
ArrayList<String> propertyIds = new ArrayList<>();
54+
propertyAvailabilityList.forEach(property -> propertyIds.add(property.getPropertyId()));
4755

48-
// call Ad Delivery API
49-
logger.info("Calling GetAdsOperation for property ids:");
50-
propertyIds.forEach(propertyId -> logger.info("Property Id: [{}]", propertyId));
56+
// call Ad Delivery API
57+
logger.info("Calling GetAdsOperation for property ids:");
58+
propertyIds.forEach(propertyId -> logger.info("Property Id: [{}]", propertyId));
5159

52-
Response<AdsResponse> adsResponse = adDeliveryService.getAds(propertyIds);
53-
logger.info("Get ads response status: [{}]", adsResponse.getStatusCode());
54-
logger.info("Get ads response, number of sponsored listings: {}", adsResponse.getData()
55-
.getSponsoredListings().size());
56-
}
60+
Response<AdsResponse> adsResponse = adDeliveryService.getAds(propertyIds);
61+
logger.info("Get ads response status: [{}]", adsResponse.getStatusCode());
62+
logger.info("Get ads response, number of sponsored listings: {}", adsResponse.getData()
63+
.getSponsoredListings().size());
64+
}
5765
}

0 commit comments

Comments
 (0)