diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-05-07 16:44:07 +0200 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-05-07 16:44:07 +0200 |
commit | 561b6ab936f1b60d364e81b08322899a931ecc2e (patch) | |
tree | bc77c6d6dc137660f34af52b53e131cba7c147d8 /same | |
parent | de32964e8cf5701590f78907ba22d5a114d8c52b (diff) |
Add ServicesPbConversion.
Used for conversion between same data types and PB data types.
Diffstat (limited to 'same')
-rw-r--r-- | same/src/main/java/com/orbekk/same/ServicesPbConversion.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/same/src/main/java/com/orbekk/same/ServicesPbConversion.java b/same/src/main/java/com/orbekk/same/ServicesPbConversion.java new file mode 100644 index 0000000..5638e1a --- /dev/null +++ b/same/src/main/java/com/orbekk/same/ServicesPbConversion.java @@ -0,0 +1,18 @@ +package com.orbekk.same; + +import java.util.ArrayList; +import java.util.List; + +public class ServicesPbConversion { + public static List<Services.Component> componentsToPb(List<State.Component> components) { + List<Services.Component> results = new ArrayList<Services.Component>(); + for (State.Component c : components) { + results.add(Services.Component.newBuilder() + .setId(c.getName()) + .setRevision(c.getRevision()) + .setData(c.getData()) + .build()); + } + return results; + } +} |