The main purpose of this example is to show you :
Setup Example
Using the SetupInterpreter
, we populate a list of province.
Setup |
Canada Province Codes |
---|---|
Name |
Code |
ALBERTA |
AB |
BRITISH COLUMBIA |
BC |
MANITOBA |
MB |
NEW BRUNSWICK |
NB |
NEWFOUNDLAND and LABRADOR |
NL |
NOVA SCOTIA |
NS |
NUNAVUT |
NU |
ONTARIO |
ON |
PRINCE EDWARD ISLAND |
PE |
QUEBEC |
QC |
SASKATCHEWAN |
SK |
From this list, we intentionnally omit the Yukon province to show the behavior of the DoSetupInterpreter
.
Using the DoSetupInterpreter
, the Yukon province will be inserted but others won't. This is because the insertProvinceWithCode method will throw an exception when we are trying to insert duplicate province data. From the row causing the exception, all the remaining rows will be skipped.
Do Setup |
Canada Province Codes |
||
---|---|---|---|
insert province |
YUKON |
with code |
YT |
insert province |
ALBERTA |
with code |
AB |
insert province |
BRITISH COLUMBIA |
with code |
BC |
List Of
Using the ListOfInterpreter
, the requirement list should be the same as the SUD list (order is important).
list of |
Canada Province Codes |
---|---|
Name |
Code |
ALBERTA |
AB |
BRITISH COLUMBIA |
BC |
MANITOBA |
MB |
NEW BRUNSWICK |
NB |
NEWFOUNDLAND and LABRADOR |
NL |
NOVA SCOTIA |
NS |
NUNAVUT |
NU |
ONTARIO |
ON |
PRINCE EDWARD ISLAND |
PE |
QUEBEC |
QC |
SASKATCHEWAN |
SK |
YUKON |
YT |
Set Of
Using the SetOfInterpreter
, the requirement set should be the same as the SUD set (order is NOT important).
set of |
Canada Province Codes |
---|---|
Name |
Code |
YUKON |
YT |
ALBERTA |
AB |
BRITISH COLUMBIA |
BC |
MANITOBA |
MB |
SASKATCHEWAN |
SK |
NEWFOUNDLAND and LABRADOR |
NL |
NOVA SCOTIA |
NS |
NUNAVUT |
NU |
PRINCE EDWARD ISLAND |
PE |
QUEBEC |
QC |
ONTARIO |
ON |
NEW BRUNSWICK |
NB |
Subset Of
Using the SubsetOfInterpreter
, the requirement set should be a subset of the SUD set (subset of the full list).
subset of |
Canada Province Codes |
---|---|
Name |
Code |
BRITISH COLUMBIA |
BC |
QUEBEC |
QC |
Superset Of
Using the SupersetOfInterpreter
, the requirement set should be a superset of the SUD set (all items in the list should be present, extra items are ignored).
superset of |
Canada Province Codes |
---|---|
Name |
Code |
ALBERTA |
AB |
BRITISH COLUMBIA |
BC |
MANITOBA |
MB |
NEW BRUNSWICK |
NB |
NEWFOUNDLAND and LABRADOR |
NL |
NOVA SCOTIA |
NS |
NUNAVUT |
NU |
ONTARIO |
ON |
PRINCE EDWARD ISLAND |
PE |
QUEBEC |
QC |
SASKATCHEWAN |
SK |
YUKON |
YT |
Other Province |
OP |