Skip to content

Commit dbe7209

Browse files
committed
update checkstyle
1 parent 1524930 commit dbe7209

File tree

4 files changed

+193
-164
lines changed

4 files changed

+193
-164
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: 108 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -11,108 +11,116 @@
1111
import com.expediagroup.sdk.rapid.examples.scenarios.geography.ParseRegionWithMultiPolygonCoordinatesScenario;
1212
import org.slf4j.Logger;
1313
import org.slf4j.LoggerFactory;
14-
1514
import java.util.concurrent.ExecutionException;
1615

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

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)