◆ getDeliveryProduct() [1/2]
Product org.turro.financials.cart.delivery.DeliveryContexts.getDeliveryProduct |
( |
Address |
address | ) |
|
Definition at line 35 of file DeliveryContexts.java.
36 for(DeliveryContext dc :
this) {
37 if(dc instanceof StreetMapContext) {
38 if(dc.match(address.getAddressString())) {
39 Product p = dc.getDeliveryProduct();
44 }
else if(dc instanceof ZipcodeContext) {
45 if(dc.match(address.getZipCode())) {
46 Product p = dc.getDeliveryProduct();
51 }
else if(dc instanceof ProvinceContext) {
52 if(dc.match(address.getProvince())) {
53 Product p = dc.getDeliveryProduct();
◆ getDeliveryProduct() [2/2]
Product org.turro.financials.cart.delivery.DeliveryContexts.getDeliveryProduct |
( |
String |
value | ) |
|
Definition at line 63 of file DeliveryContexts.java.
64 for(DeliveryContext dc :
this) {
65 if(dc instanceof ValueContext) {
67 Product p = dc.getDeliveryProduct();
◆ getDeliveryStreets()
List<StreetItem> org.turro.financials.cart.delivery.DeliveryContexts.getDeliveryStreets |
( |
String |
search | ) |
|
Definition at line 87 of file DeliveryContexts.java.
88 List<StreetItem> streets =
new ArrayList<>();
89 for(DeliveryContext dc :
this) {
90 if(dc instanceof StreetMapContext) {
91 streets.addAll(((StreetMapContext) dc).getStreets(search));
◆ getDeliveryValues()
Set<String> org.turro.financials.cart.delivery.DeliveryContexts.getDeliveryValues |
( |
| ) |
|
Definition at line 77 of file DeliveryContexts.java.
78 Set<String> values =
new HashSet<>();
79 for(DeliveryContext dc :
this) {
80 if(dc instanceof ValueContext) {
81 values.addAll(((ValueContext) dc).getValues());
◆ isStreetBased()
boolean org.turro.financials.cart.delivery.DeliveryContexts.isStreetBased |
( |
| ) |
|
Definition at line 97 of file DeliveryContexts.java.
98 return this.stream().anyMatch((dc) -> (dc instanceof StreetMapContext));
◆ readXML()
void org.turro.financials.cart.delivery.DeliveryContexts.readXML |
( |
Element |
root | ) |
|
Definition at line 101 of file DeliveryContexts.java.
102 List<Element> children = root.getChildren(
"DeliveryByStreetMap");
103 for(Element el : children) {
104 add(
new StreetMapContext(el.getAttributeValue(
"value"),
105 Long.valueOf(el.getAttributeValue(
"product")),
106 Long.valueOf(el.getAttributeValue(
"store")),
107 el.getAttributeValue(
"logistic")));
109 children = root.getChildren(
"DeliveryByZipcode");
110 for(Element el : children) {
111 add(
new ZipcodeContext(el.getAttributeValue(
"value"),
112 Long.valueOf(el.getAttributeValue(
"product")),
113 Long.valueOf(el.getAttributeValue(
"store")),
114 el.getAttributeValue(
"logistic")));
116 children = root.getChildren(
"DeliveryByProvince");
117 for(Element el : children) {
118 add(
new ProvinceContext(el.getAttributeValue(
"value"),
119 Long.valueOf(el.getAttributeValue(
"product")),
120 Long.valueOf(el.getAttributeValue(
"store")),
121 el.getAttributeValue(
"logistic")));
123 children = root.getChildren(
"DeliveryByValue");
124 for(Element el : children) {
125 add(
new ValueContext(el.getAttributeValue(
"value"),
126 Long.valueOf(el.getAttributeValue(
"product")),
127 Long.valueOf(el.getAttributeValue(
"store")),
128 el.getAttributeValue(
"logistic")));
The documentation for this class was generated from the following file: