This is an automated email from the ASF dual-hosted git repository. carlosrovira pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push: new 3e7aa59 update amf example to use Array instead of ArrayList in client. Make java part use Set instead of array of objects in some parts 3e7aa59 is described below commit 3e7aa59bc3c32e11a5a579b2e502c2bea3373bf1 Author: Carlos Rovira <carlosrov...@apache.org> AuthorDate: Sun May 27 11:10:33 2018 +0200 update amf example to use Array instead of ArrayList in client. Make java part use Set instead of array of objects in some parts --- .../amfsamples/services/CompressedService.java | 21 +++++++++++++++++++-- .../royale/amfsamples/services/ExampleService.java | 8 ++++---- .../royale/amfsamples/valueobjects/Product.java | 6 +++--- .../src/main/royale/valueObjects/Product.as | 12 ++++-------- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/CompressedService.java b/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/CompressedService.java index a5e41c4..d5ab072 100644 --- a/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/CompressedService.java +++ b/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/CompressedService.java @@ -50,7 +50,24 @@ public class CompressedService { product.setTaxonomy(taxonomy); - Object[] zones = new Object[3]; + Set<Zone> zones = new HashSet<Zone>(); + + Zone zone1 = new Zone(); + zone1.setId(1); + zone1.setName("Europe"); + zones.add(zone1); + + Zone zone2 = new Zone(); + zone2.setId(2); + zone2.setName("USA"); + zones.add(zone2); + + Zone zone3 = new Zone(); + zone3.setId(3); + zone3.setName("Asia"); + zones.add(zone3); + + /*Object[] zones = new Object[3]; for (int i = 0; i < zones.length; i++) { Zone zone = new Zone(); @@ -62,7 +79,7 @@ public class CompressedService { else if (i == 2) zone.setName("Asia"); zones[i] = zone; - } + }*/ product.setZones(zones); diff --git a/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/ExampleService.java b/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/ExampleService.java index 5582881..2ccdce9 100644 --- a/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/ExampleService.java +++ b/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/services/ExampleService.java @@ -79,7 +79,7 @@ public class ExampleService { product.setTaxonomy(taxonomy); - /*List<Zone> zones = new ArrayList<Zone>(); + Set<Zone> zones = new HashSet<Zone>(); Zone zone1 = new Zone(); zone1.setId(1); @@ -95,9 +95,9 @@ public class ExampleService { zone3.setId(3); zone3.setName("Asia"); zones.add(zone3); - */ + - Object[] zones = new Object[3]; + /*Object[] zones = new Object[3]; for (int i = 0; i < zones.length; i++) { Zone zone = new Zone(); @@ -109,7 +109,7 @@ public class ExampleService { else if (i == 2) zone.setName("Asia"); zones[i] = zone; - } + }*/ product.setZones(zones); diff --git a/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/valueobjects/Product.java b/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/valueobjects/Product.java index 81957a1..49151cb 100644 --- a/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/valueobjects/Product.java +++ b/examples/amf/SampleAmfWebApp/src/main/java/org/apache/royale/amfsamples/valueobjects/Product.java @@ -28,7 +28,7 @@ public class Product private String name; private String description; private Taxonomy taxonomy; - private Object[] zones; + private Set<Zone> zones; public Product() { @@ -66,7 +66,7 @@ public class Product * * @return The zone list. */ - public Object[] getZones() { + public Set<Zone> getZones() { return zones; } @@ -75,7 +75,7 @@ public class Product * * @param zones The zones list. */ - public void setZones(Object[] zones) { + public void setZones(Set<Zone> zones) { this.zones = zones; } diff --git a/examples/royale/RemoteObjectAMFTest/src/main/royale/valueObjects/Product.as b/examples/royale/RemoteObjectAMFTest/src/main/royale/valueObjects/Product.as index 1210986..ce296c2 100644 --- a/examples/royale/RemoteObjectAMFTest/src/main/royale/valueObjects/Product.as +++ b/examples/royale/RemoteObjectAMFTest/src/main/royale/valueObjects/Product.as @@ -18,10 +18,6 @@ //////////////////////////////////////////////////////////////////////////////// package valueObjects { - import org.apache.royale.collections.ArrayList; - - //import org.apache.royale.collections.ArrayList; - [RemoteClass(alias="org.apache.royale.amfsamples.valueobjects.Product")] public class Product { @@ -65,7 +61,7 @@ package valueObjects _taxonomy = value; } - // collection of zones (Zone - ArrayList) + // collection of zones (Zone), we can use Array and ArrayList private var _zones:Array; public function get zones():Array @@ -78,14 +74,14 @@ package valueObjects _zones = value; } - private var _flavors:ArrayList = null; + private var _flavors:Array = null; - public function get flavors():ArrayList + public function get flavors():Array { return _flavors; } - public function set flavors(value:ArrayList):void + public function set flavors(value:Array):void { _flavors = value; } -- To stop receiving notification emails like this one, please contact carlosrov...@apache.org.