summaryrefslogtreecommitdiff
path: root/same/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'same/src/main/java/com')
-rw-r--r--same/src/main/java/com/orbekk/same/ServicesPbConversion.java18
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;
+ }
+}