diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionInput.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionInput.java
new file mode 100644
index 0000000..fe4d1a4
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionInput.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import org.onosproject.nemo.model.common.UserId;
+
+/**
+ * Representation of the beginning transaction input.
+ */
+public interface BeginTransactionInput {
+
+    /**
+     * Returns a unique identifier for a user.
+     *
+     * @return the user's identifier
+     */
+    UserId getUserId();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionInputBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionInputBuilder.java
new file mode 100644
index 0000000..3686429
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionInputBuilder.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import org.onosproject.nemo.model.common.UserId;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * Representation of the beginning transaction input builder.
+ */
+public class BeginTransactionInputBuilder {
+
+    private Map<Class<? extends BeginTransactionInput>, BeginTransactionInput>
+            augmentation = new HashMap<>();
+
+    private UserId userId;
+
+    /**
+     * Creates a beginning transaction input builder.
+     */
+    public BeginTransactionInputBuilder() {
+    }
+
+    /**
+     * Creates a beginning transaction input builder from
+     * a beginning transaction input.
+     *
+     * @param base a beginning transaction input builder object
+     */
+    public BeginTransactionInputBuilder(BeginTransactionInput base) {
+        userId = base.getUserId();
+        if (base instanceof BeginTransactionInputImpl) {
+            BeginTransactionInputImpl impl = (BeginTransactionInputImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Sets the user ID for the builder to use.
+     *
+     * @param id user's ID to set
+     * @return self
+     */
+    public BeginTransactionInputBuilder userId(UserId id) {
+        userId = id;
+        return this;
+    }
+
+    /**
+     * Adds augmentation by a class type and a beginning transaction input.
+     * If the augmentation is null, remove the augmentation type
+     * key from the hash map.
+     *
+     * @param augmentationType class extends BeginTransactionInput
+     * @param augmentation a beginning transaction input object
+     * @return self
+     */
+    public BeginTransactionInputBuilder addAugmentation(
+            Class<? extends BeginTransactionInput> augmentationType,
+            BeginTransactionInput augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Removes augmentation by a class type.
+     *
+     * @param augmentationType class extends BeginTransactionInput
+     * @return self
+     */
+    public BeginTransactionInputBuilder removeAugmentation(
+            Class<? extends BeginTransactionInput> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds a beginning transaction input object.
+     *
+     * @return beginning transaction input object
+     */
+    public BeginTransactionInput build() {
+        return new BeginTransactionInputImpl(this);
+    }
+
+    /**
+     * Representation of the implement of BeginTransactionInput.
+     */
+    private static final class BeginTransactionInputImpl
+            implements BeginTransactionInput {
+
+        private final UserId userId;
+
+        private final Map<Class<? extends BeginTransactionInput>,
+                BeginTransactionInput> augmentation;
+
+        private BeginTransactionInputImpl(BeginTransactionInputBuilder base) {
+            userId = base.userId;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public UserId getUserId() {
+            return userId;
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(userId, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            BeginTransactionInputImpl other = (BeginTransactionInputImpl) obj;
+            return Objects.equals(userId, other.getUserId()) &&
+                    Objects.equals(augmentation, other.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("userId", userId)
+                    .add("augmentation", augmentation).toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionOutput.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionOutput.java
new file mode 100644
index 0000000..47cbc8b
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionOutput.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+/**
+ * Representation of the beginning transaction output.
+ */
+public interface BeginTransactionOutput extends DefaultOutput {
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionOutputBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionOutputBuilder.java
new file mode 100644
index 0000000..fe2948f
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/BeginTransactionOutputBuilder.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+/**
+ * Representation of the beginning transaction output builder.
+ */
+public class BeginTransactionOutputBuilder extends DefaultOutputBuilderBase {
+
+    private Map<Class<? extends BeginTransactionOutput>, BeginTransactionOutput>
+            augmentation = new HashMap<>();
+
+    /**
+     * Creates a beginning transaction output builder.
+     */
+    public BeginTransactionOutputBuilder() {
+    }
+
+    /**
+     * Creates the beginning transaction output builder from a RPC result.
+     *
+     * @param rpc a common RPC result
+     */
+    public BeginTransactionOutputBuilder(CommonRpcResult rpc) {
+        resultCode = rpc.getResultCode();
+        message = rpc.getMessage();
+    }
+
+    /**
+     * Creates a beginning transaction output builder from
+     * a beginning transaction output.
+     *
+     * @param base beginning transaction output object
+     */
+    public BeginTransactionOutputBuilder(BeginTransactionOutput base) {
+        message = base.getMessage();
+        resultCode = base.getResultCode();
+        if (base instanceof BeginTransactionOutputImpl) {
+            BeginTransactionOutputImpl impl = (BeginTransactionOutputImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Adds augmentation by a class type and a beginning transaction output.
+     * If the augmentation is null, remove the augmentation type key
+     * from the hash map.
+     *
+     * @param augmentationType class extends BeginTransactionOutput interface
+     * @param augmentation a beginning transaction output
+     * @return self
+     */
+    public BeginTransactionOutputBuilder addAugmentation(
+            Class<? extends BeginTransactionOutput> augmentationType,
+            BeginTransactionOutput augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Removes augmentation by a class type.
+     *
+     * @param augmentationType class extends BeginTransactionOutput interface
+     * @return self
+     */
+    public BeginTransactionOutputBuilder removeAugmentation(
+            Class<? extends BeginTransactionOutput> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds a beginning transaction output object.
+     *
+     * @return a beginning transaction output object
+     */
+    public BeginTransactionOutput build() {
+        return new BeginTransactionOutputImpl(this);
+    }
+
+    /**
+     * Representation of the implement of BeginTransactionOutput.
+     */
+    private static final class BeginTransactionOutputImpl
+            extends DefaultOutputImplBase
+            implements BeginTransactionOutput {
+
+        private final Map<Class<? extends BeginTransactionOutput>,
+                BeginTransactionOutput> augmentation;
+
+        private BeginTransactionOutputImpl(BeginTransactionOutputBuilder base) {
+            message = base.message;
+            resultCode = base.resultCode;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(message, resultCode, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            BeginTransactionOutputImpl other =
+                    (BeginTransactionOutputImpl) obj;
+            return Objects.equals(message, other.getMessage()) &&
+                    Objects.equals(resultCode, other.getResultCode()) &&
+                    Objects.equals(augmentation, other.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("message", message)
+                    .add("resultCode", resultCode)
+                    .add("augmentation", augmentation).toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/CommonRpcResult.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/CommonRpcResult.java
new file mode 100644
index 0000000..fe4d95f
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/CommonRpcResult.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import java.util.Map;
+import com.google.common.collect.ImmutableMap;
+
+/**
+ * Representation of common RPC result.
+ */
+public interface CommonRpcResult {
+
+    /**
+     * Returns result code.
+     *
+     * @return result code
+     */
+    Code getResultCode();
+
+    /**
+     * Returns message.
+     *
+     * @return message
+     */
+    String getMessage();
+
+    /**
+     * Representation of result code enum.
+     */
+    enum Code {
+
+        /**
+         * The invoked RPC was executed successfully.
+         */
+        OK(0),
+
+        /**
+         * An error occurred while executing the RPC.
+         */
+        ERROR(1);
+
+        private static final Map<Integer, Code> VALUE_MAP;
+
+        int value;
+
+        Code(int value) {
+            this.value = value;
+        }
+
+        /**
+         * Returns integer value.
+         *
+         * @return integer value
+         */
+        public int intValue() {
+            return value;
+        }
+
+        static {
+            ImmutableMap.Builder<Integer, Code> b = ImmutableMap.builder();
+            for (Code enumItem : Code.values()) {
+                b.put(enumItem.value, enumItem);
+            }
+            VALUE_MAP = b.build();
+        }
+
+        /**
+         * Returns result code by value.
+         *
+         * @param value a map key value
+         * @return corresponding result code constant
+         */
+        public static Code forValue(int value) {
+            Code code = VALUE_MAP.get(value);
+            if (code == null) {
+                throw new IllegalArgumentException(
+                        String.format("Param %d is not valid", value));
+            }
+            return code;
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/DefaultOutput.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/DefaultOutput.java
new file mode 100644
index 0000000..64ee555
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/DefaultOutput.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import org.onosproject.nemo.model.intent.CommonRpcResult.Code;
+
+/**
+ * Representation of the default output.
+ */
+public interface DefaultOutput {
+
+    /**
+     * Returns message.
+     *
+     * @return message
+     */
+    String getMessage();
+
+    /**
+     * Returns result code.
+     *
+     * @return result code
+     */
+    Code getResultCode();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/DefaultOutputBuilderBase.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/DefaultOutputBuilderBase.java
new file mode 100644
index 0000000..fe19437
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/DefaultOutputBuilderBase.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import org.onosproject.nemo.model.intent.CommonRpcResult.Code;
+
+/**
+ * Representation of the base of output builder.
+ */
+public class DefaultOutputBuilderBase {
+
+    /**
+     * Message for the builder to use.
+     */
+    protected String message;
+    /**
+     * Result code for the builder to use.
+     */
+    protected Code resultCode;
+
+    /**
+     * Sets the message for the builder to use.
+     *
+     * @param msg message to set
+     * @return self
+     */
+    public DefaultOutputBuilderBase message(String msg) {
+        message = msg;
+        return this;
+    }
+
+    /**
+     * Sets the result code for the builder to use.
+     *
+     * @param code result code to set
+     * @return self
+     */
+    public DefaultOutputBuilderBase resultCode(Code code) {
+        resultCode = code;
+        return this;
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/DefaultOutputImplBase.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/DefaultOutputImplBase.java
new file mode 100644
index 0000000..1a816ba
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/DefaultOutputImplBase.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import org.onosproject.nemo.model.intent.CommonRpcResult.Code;
+
+/**
+ * Representation of the base of output implement.
+ */
+public abstract class DefaultOutputImplBase {
+
+    /**
+     * Message.
+     */
+    protected String message = null;
+
+    /**
+     * Result code.
+     */
+    protected Code resultCode = null;
+
+    /**
+     * Returns message.
+     *
+     * @return message
+     */
+    public String getMessage() {
+        return message;
+    }
+
+    /**
+     * Returns result code.
+     *
+     * @return result code
+     */
+    public Code getResultCode() {
+        return resultCode;
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionInput.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionInput.java
new file mode 100644
index 0000000..4d138dd
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionInput.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import org.onosproject.nemo.model.common.UserId;
+
+/**
+ * Representation of the end transaction input.
+ */
+public interface EndTransactionInput {
+
+    /**
+     * Returns user's identifier.
+     *
+     * @return user's identifier
+     */
+    UserId getUserId();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionInputBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionInputBuilder.java
new file mode 100644
index 0000000..c88ed0e
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionInputBuilder.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import org.onosproject.nemo.model.common.UserId;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * Representation of the end transaction input builder.
+ */
+public class EndTransactionInputBuilder {
+
+    private Map<Class<? extends EndTransactionInput>, EndTransactionInput>
+            augmentation = new HashMap<>();
+
+    private UserId userId;
+
+    /**
+     * Creates an end transaction input builder.
+     */
+    public EndTransactionInputBuilder() {
+    }
+
+    /**
+     * Creates an end transaction input builder from
+     * the end transaction input.
+     *
+     * @param base EndTransactionInput object
+     */
+    public EndTransactionInputBuilder(EndTransactionInput base) {
+        userId = base.getUserId();
+        if (base instanceof EndTransactionInputImpl) {
+            EndTransactionInputImpl impl = (EndTransactionInputImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Sets the user ID for the builder to use.
+     *
+     * @param id user's ID
+     * @return self
+     */
+    public EndTransactionInputBuilder userId(UserId id) {
+        userId = id;
+        return this;
+    }
+
+    /**
+     * Adds augmentation by a class type and an end transaction input.
+     * If the augmentation is null, remove the augmentation type key
+     * from the hash map.
+     *
+     * @param augmentationType class extends EndTransactionInput
+     * @param augmentation EndTransactionInput object
+     * @return self
+     */
+    public EndTransactionInputBuilder addAugmentation(
+            Class<? extends EndTransactionInput> augmentationType,
+            EndTransactionInput augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Removes augmentation a class type.
+     *
+     * @param augmentationType class that extends EndTransactionInput
+     * @return self
+     */
+    public EndTransactionInputBuilder removeAugmentation(
+            Class<? extends EndTransactionInput> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds an end transaction input builder object.
+     *
+     * @return an end transaction input builder object
+     */
+    public EndTransactionInput build() {
+        return new EndTransactionInputImpl(this);
+    }
+
+    /**
+     * Representation of the implement of EndTransactionInput.
+     */
+    private static final class EndTransactionInputImpl
+            implements EndTransactionInput {
+
+        private final UserId userId;
+
+        private final Map<Class<? extends EndTransactionInput>,
+                EndTransactionInput> augmentation;
+
+        private EndTransactionInputImpl(EndTransactionInputBuilder base) {
+            userId = base.userId;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public UserId getUserId() {
+            return userId;
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(userId, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            EndTransactionInputImpl other = (EndTransactionInputImpl) obj;
+            return Objects.equals(userId, other.getUserId()) &&
+                    Objects.equals(augmentation, other.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("userId", userId)
+                    .add("augmentation", augmentation).toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionOutput.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionOutput.java
new file mode 100644
index 0000000..fe7ac22
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionOutput.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+/**
+ * Representation of the end transaction output.
+ */
+public interface EndTransactionOutput extends DefaultOutput {
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionOutputBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionOutputBuilder.java
new file mode 100644
index 0000000..5692c73
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/EndTransactionOutputBuilder.java
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+/**
+ * Representation of the end transaction output builder.
+ */
+public class EndTransactionOutputBuilder extends DefaultOutputBuilderBase {
+
+    private Map<Class<? extends EndTransactionOutput>, EndTransactionOutput>
+            augmentation = new HashMap<>();
+
+    /**
+     * Creates an end transaction output builder object.
+     */
+    public EndTransactionOutputBuilder() {
+    }
+
+    /**
+     * Creates an end transaction output builder object from a RPC result.
+     *
+     * @param rpc a common RPC result
+     */
+    public EndTransactionOutputBuilder(CommonRpcResult rpc) {
+        resultCode = rpc.getResultCode();
+        message = rpc.getMessage();
+    }
+
+    /**
+     * Creates an end transaction output builder object from
+     * the end transaction output.
+     *
+     * @param base end transaction output object
+     */
+    public EndTransactionOutputBuilder(EndTransactionOutput base) {
+        message = base.getMessage();
+        resultCode = base.getResultCode();
+        if (base instanceof EndTransactionOutputImpl) {
+            EndTransactionOutputImpl impl = (EndTransactionOutputImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Adds augmentation by a class type and an end transaction output.
+     * If the augmentation is null, remove the augmentation type key
+     * from the hash map.
+     *
+     * @param augmentationType class that extends EndTransactionOutput
+     * @param augmentation EndTransactionOutput object
+     * @return self
+     */
+    public EndTransactionOutputBuilder addAugmentation(
+            Class<? extends EndTransactionOutput> augmentationType,
+            EndTransactionOutput augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Removes augmentation by a class type.
+     *
+     * @param augmentationType class that extends EndTransactionOutput
+     * @return self
+     */
+    public EndTransactionOutputBuilder removeAugmentation(
+            Class<? extends EndTransactionOutput> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Returns an end transaction output object.
+     *
+     * @return an end transaction output object
+     */
+    public EndTransactionOutput build() {
+        return new EndTransactionOutputImpl(this);
+    }
+
+    /**
+     * Representation of the implement of EndTransactionOutput.
+     */
+    private static final class EndTransactionOutputImpl
+            extends DefaultOutputImplBase
+            implements EndTransactionOutput {
+
+        private final Map<Class<? extends EndTransactionOutput>,
+                EndTransactionOutput> augmentation;
+
+        private EndTransactionOutputImpl(EndTransactionOutputBuilder base) {
+            message = base.message;
+            resultCode = base.resultCode;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(message, resultCode, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            EndTransactionOutputImpl other = (EndTransactionOutputImpl) obj;
+            return Objects.equals(message, other.getMessage()) &&
+                    Objects.equals(resultCode, other.getResultCode()) &&
+                    Objects.equals(augmentation, other.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("message", message)
+                    .add("resultCode", resultCode)
+                    .add("augmentation", augmentation).toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestInput.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestInput.java
new file mode 100644
index 0000000..d0be471
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestInput.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import org.onosproject.nemo.model.common.UserId;
+
+/**
+ * Representation of language style request input.
+ */
+public interface LanguageStyleNemoRequestInput {
+
+    /**
+     * Returns user's identifier.
+     *
+     * @return user identifier
+     */
+    UserId getUserId();
+
+    /**
+     * Returns statement.
+     *
+     * @return statement
+     */
+    String getNemoStatement();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestInputBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestInputBuilder.java
new file mode 100644
index 0000000..705d750
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestInputBuilder.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import org.onosproject.nemo.model.common.UserId;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * Representation of language style request input object builder.
+ */
+public class LanguageStyleNemoRequestInputBuilder {
+
+    private Map<Class<? extends LanguageStyleNemoRequestInput>,
+            LanguageStyleNemoRequestInput> augmentation = new HashMap<>();
+
+    private String nemoStatement;
+
+    private UserId userId;
+
+    /**
+     * Creates a language style request input builder.
+     */
+    public LanguageStyleNemoRequestInputBuilder() {
+    }
+
+    /**
+     * Creates a language style request input builder from
+     * the language style request input.
+     *
+     * @param base language style request input object
+     */
+    public LanguageStyleNemoRequestInputBuilder(LanguageStyleNemoRequestInput base) {
+        nemoStatement = base.getNemoStatement();
+        userId = base.getUserId();
+        if (base instanceof LanguageStyleNemoRequestInputImpl) {
+            LanguageStyleNemoRequestInputImpl impl =
+                    (LanguageStyleNemoRequestInputImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Sets the statement for the builder to use.
+     *
+     * @param statement statement
+     * @return self
+     */
+    public LanguageStyleNemoRequestInputBuilder nemoStatement(String statement) {
+        nemoStatement = statement;
+        return this;
+    }
+
+    /**
+     * Sets the user ID for the builder to use.
+     *
+     * @param id user ID
+     * @return self
+     */
+    public LanguageStyleNemoRequestInputBuilder userId(UserId id) {
+        userId = id;
+        return this;
+    }
+
+    /**
+     * Adds augmentation by a class type and a language style request input.
+     * If the augmentation is null,remove the augmentation type key
+     * from the hash map.
+     *
+     * @param augmentationType type that extends LanguageStyleNemoRequestInput
+     * @param augmentation an language style request input object
+     * @return self
+     */
+    public LanguageStyleNemoRequestInputBuilder addAugmentation(
+            Class<? extends LanguageStyleNemoRequestInput> augmentationType,
+            LanguageStyleNemoRequestInput augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Removes augmentation by a class type.
+     *
+     * @param augmentationType type that extends LanguageStyleNemoRequestInput
+     * @return self
+     */
+    public LanguageStyleNemoRequestInputBuilder removeAugmentation(
+            Class<? extends LanguageStyleNemoRequestInput> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds a language style request input object.
+     *
+     * @return a language style request input object
+     */
+    public LanguageStyleNemoRequestInput build() {
+        return new LanguageStyleNemoRequestInputImpl(this);
+    }
+
+    /**
+     * Representation of the implement of LanguageStyleNemoRequestInput.
+     */
+    private static final class LanguageStyleNemoRequestInputImpl
+            implements LanguageStyleNemoRequestInput {
+
+        private final String nemoStatement;
+
+        private final UserId userId;
+
+        private final Map<Class<? extends LanguageStyleNemoRequestInput>,
+                LanguageStyleNemoRequestInput> augmentation;
+
+        private LanguageStyleNemoRequestInputImpl(
+                LanguageStyleNemoRequestInputBuilder base) {
+            nemoStatement = base.nemoStatement;
+            userId = base.userId;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public String getNemoStatement() {
+            return nemoStatement;
+        }
+
+        @Override
+        public UserId getUserId() {
+            return userId;
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(nemoStatement, userId, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            LanguageStyleNemoRequestInputImpl other =
+                    (LanguageStyleNemoRequestInputImpl) obj;
+            return Objects.equals(nemoStatement, other.getNemoStatement()) &&
+                    Objects.equals(userId, other.getUserId()) &&
+                    Objects.equals(augmentation, other.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("nemoStatement", nemoStatement)
+                    .add("userId", userId)
+                    .add("augmentation", augmentation).toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestOutput.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestOutput.java
new file mode 100644
index 0000000..e571974
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestOutput.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+/**
+ * Representation of the language style request output.
+ */
+public interface LanguageStyleNemoRequestOutput extends DefaultOutput {
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestOutputBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestOutputBuilder.java
new file mode 100644
index 0000000..bf96be6
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestOutputBuilder.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+/**
+ * Representation of language style request output builder.
+ */
+public class LanguageStyleNemoRequestOutputBuilder
+        extends DefaultOutputBuilderBase {
+
+    private Map<Class<? extends LanguageStyleNemoRequestOutput>,
+            LanguageStyleNemoRequestOutput> augmentation = new HashMap<>();
+
+    /**
+     * Constructs a language style request output builder object.
+     */
+    public LanguageStyleNemoRequestOutputBuilder() {
+    }
+
+    /**
+     * Constructs a language style request output builder object.
+     *
+     * @param rpc common RPC result
+     */
+    public LanguageStyleNemoRequestOutputBuilder(CommonRpcResult rpc) {
+        resultCode = rpc.getResultCode();
+        message = rpc.getMessage();
+    }
+
+    /**
+     * Constructs a language style request output object.
+     *
+     * @param base language style request output object
+     */
+    public LanguageStyleNemoRequestOutputBuilder(
+            LanguageStyleNemoRequestOutput base) {
+        message = base.getMessage();
+        resultCode = base.getResultCode();
+        if (base instanceof LanguageStyleNemoRequestOutputImpl) {
+            LanguageStyleNemoRequestOutputImpl impl =
+                    (LanguageStyleNemoRequestOutputImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Adds augmentation by a class type and a language style request output.
+     * If the augmentation is null, remove the augmentation type key
+     * from the hash map.
+     *
+     * @param augmentationType type that extends LanguageStyleNemoRequestOutput
+     * @param augmentation language style request output object
+     * @return self
+     */
+    public LanguageStyleNemoRequestOutputBuilder addAugmentation(
+            Class<? extends LanguageStyleNemoRequestOutput> augmentationType,
+            LanguageStyleNemoRequestOutput augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Removes augmentation by a class type.
+     *
+     * @param augmentationType type that extends LanguageStyleNemoRequestOutput
+     * @return self
+     */
+    public LanguageStyleNemoRequestOutputBuilder removeAugmentation(
+            Class<? extends LanguageStyleNemoRequestOutput> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds a language style request output object.
+     *
+     * @return a language style request output object
+     */
+    public LanguageStyleNemoRequestOutput build() {
+        return new LanguageStyleNemoRequestOutputImpl(this);
+    }
+
+    /**
+     * Representation of the implement of LanguageStyleNemoRequestOutput.
+     */
+    private static final class LanguageStyleNemoRequestOutputImpl
+            extends DefaultOutputImplBase
+            implements LanguageStyleNemoRequestOutput {
+
+        private final Map<Class<? extends LanguageStyleNemoRequestOutput>,
+                LanguageStyleNemoRequestOutput> augmentation;
+
+        private LanguageStyleNemoRequestOutputImpl(
+                LanguageStyleNemoRequestOutputBuilder base) {
+            message = base.message;
+            resultCode = base.resultCode;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(message, resultCode, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            LanguageStyleNemoRequestOutputImpl other =
+                    (LanguageStyleNemoRequestOutputImpl) obj;
+            return Objects.equals(message, other.getMessage()) &&
+                    Objects.equals(resultCode, other.getResultCode()) &&
+                    Objects.equals(augmentation, other.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("message", message)
+                    .add("resultCode", resultCode)
+                    .add("augmentation", augmentation).toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/RegisterUserInput.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/RegisterUserInput.java
new file mode 100644
index 0000000..76631d8
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/RegisterUserInput.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import org.onosproject.nemo.model.common.UserId;
+import org.onosproject.nemo.model.common.UserName;
+import org.onosproject.nemo.model.common.UserPassword;
+import org.onosproject.nemo.model.common.UserRoleName;
+
+/**
+ * Representation of register user input.
+ */
+public interface RegisterUserInput {
+
+    /**
+     * Returns user's identifier.
+     *
+     * @return a unique ID for a user.
+     */
+    UserId getUserId();
+
+    /**
+     * Returns user's name.
+     *
+     * @return a user-visible and unique name for the user.
+     */
+    UserName getUserName();
+
+    /**
+     * Returns user's password.
+     *
+     * @return a password of a user.
+     */
+    UserPassword getUserPassword();
+
+    /**
+     * Returns user's role.
+     *
+     * @return a role of a user.
+     */
+    UserRoleName getUserRole();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/RegisterUserOutput.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/RegisterUserOutput.java
new file mode 100644
index 0000000..6652dbd
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/RegisterUserOutput.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+/**
+ * Representation of register user output.
+ */
+public interface RegisterUserOutput extends DefaultOutput {
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/RegisterUserOutputBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/RegisterUserOutputBuilder.java
new file mode 100644
index 0000000..58ca040
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/RegisterUserOutputBuilder.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+/**
+ * Representation of register user output builder.
+ */
+public class RegisterUserOutputBuilder extends DefaultOutputBuilderBase {
+
+    private Map<Class<? extends RegisterUserOutput>, RegisterUserOutput>
+            augmentation = new HashMap<>();
+
+    public RegisterUserOutputBuilder() {
+    }
+
+    /**
+     * Constructs the register user output builder from a result code.
+     *
+     * @param rpc common RPC result
+     */
+    public RegisterUserOutputBuilder(CommonRpcResult rpc) {
+        resultCode = rpc.getResultCode();
+        message = rpc.getMessage();
+    }
+
+    /**
+     * Constructs register user output builder.
+     *
+     * @param base register user output object
+     */
+    public RegisterUserOutputBuilder(RegisterUserOutput base) {
+        message = base.getMessage();
+        resultCode = base.getResultCode();
+        if (base instanceof RegisterUserOutputImpl) {
+            RegisterUserOutputImpl impl = (RegisterUserOutputImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Adds augmentation by a class type and a register user output.
+     * If the augmentation is null, remove the augmentation type key
+     * from the hash map.
+     *
+     * @param augmentationType type that extends RegisterUserOutput
+     * @param augmentation register user output object
+     * @return self
+     */
+    public RegisterUserOutputBuilder addAugmentation(
+            Class<? extends RegisterUserOutput> augmentationType,
+            RegisterUserOutput augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Removes augmentation by a class type.
+     *
+     * @param augmentationType type that extends RegisterUserOutput
+     * @return self
+     */
+    public RegisterUserOutputBuilder removeAugmentation(
+            Class<? extends RegisterUserOutput> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds a register user output object.
+     *
+     * @return the register user output object
+     */
+    public RegisterUserOutput build() {
+        return new RegisterUserOutputImpl(this);
+    }
+
+    /**
+     * Representation of the implement of RegisterUserOutput.
+     */
+    private static final class RegisterUserOutputImpl
+            extends DefaultOutputImplBase
+            implements RegisterUserOutput {
+
+        private final Map<Class<? extends RegisterUserOutput>, RegisterUserOutput>
+                augmentation;
+
+        private RegisterUserOutputImpl(RegisterUserOutputBuilder base) {
+            message = base.message;
+            resultCode = base.resultCode;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(message, resultCode, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            RegisterUserOutputImpl other = (RegisterUserOutputImpl) obj;
+            return Objects.equals(message, other.getMessage()) &&
+                    Objects.equals(resultCode, other.getResultCode()) &&
+                    Objects.equals(augmentation, other.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("message", message)
+                    .add("resultCode", resultCode)
+                    .add("augmentation", augmentation).toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoDeleteOutput.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoDeleteOutput.java
new file mode 100644
index 0000000..a406d3d
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoDeleteOutput.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+/**
+ * Representation of structure style delete output.
+ */
+public interface StructureStyleNemoDeleteOutput extends DefaultOutput {
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoDeleteOutputBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoDeleteOutputBuilder.java
new file mode 100644
index 0000000..0feb8ec
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoDeleteOutputBuilder.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+/**
+ * Representation of structure style delete output builder.
+ */
+public class StructureStyleNemoDeleteOutputBuilder
+        extends DefaultOutputBuilderBase {
+
+    Map<Class<? extends StructureStyleNemoDeleteOutput>,
+            StructureStyleNemoDeleteOutput> augmentation
+            = new HashMap<>();
+
+    /**
+     * Constructs structure style delete output builder.
+     */
+    public StructureStyleNemoDeleteOutputBuilder() {
+    }
+
+    /**
+     * Constructs structure style delete output builder
+     * from a RPC result.
+     *
+     * @param rpc common RPC result
+     */
+    public StructureStyleNemoDeleteOutputBuilder(CommonRpcResult rpc) {
+        resultCode = rpc.getResultCode();
+        message = rpc.getMessage();
+    }
+
+    /**
+     * Constructs structure style delete output builder from
+     * a structure style delete output.
+     *
+     * @param base structure style delete output object
+     */
+    public StructureStyleNemoDeleteOutputBuilder(
+            StructureStyleNemoDeleteOutput base) {
+        message = base.getMessage();
+        resultCode = base.getResultCode();
+        if (base instanceof StructureStyleNemoDeleteOutputImpl) {
+            StructureStyleNemoDeleteOutputImpl impl =
+                    (StructureStyleNemoDeleteOutputImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Adds augmentation by a class type and a structure style delete
+     * output object.If the augmentation is null,remove the augmentation
+     * type key from the hash map.
+     *
+     * @param augmentationType type that extends StructureStyleNemoDeleteOutput
+     * @param augmentation structure style delete output object
+     * @return self
+     */
+    public StructureStyleNemoDeleteOutputBuilder addAugmentation(
+            Class<? extends StructureStyleNemoDeleteOutput> augmentationType,
+            StructureStyleNemoDeleteOutput augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Removes augmentation by a class type.
+     *
+     * @param augmentationType type that extends StructureStyleNemoDeleteOutput
+     * @return self
+     */
+    public StructureStyleNemoDeleteOutputBuilder removeAugmentation(
+            Class<? extends StructureStyleNemoDeleteOutput> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds structure style delete output object.
+     *
+     * @return structure style delete output object
+     */
+    public StructureStyleNemoDeleteOutput build() {
+        return new StructureStyleNemoDeleteOutputImpl(this);
+    }
+
+    /**
+     * Representation of the implement of StructureStyleNemoDeleteOutput.
+     */
+    private static final class StructureStyleNemoDeleteOutputImpl
+            extends DefaultOutputImplBase
+            implements StructureStyleNemoDeleteOutput {
+
+        private final Map<Class<? extends StructureStyleNemoDeleteOutput>,
+                StructureStyleNemoDeleteOutput> augmentation;
+
+        private StructureStyleNemoDeleteOutputImpl(
+                StructureStyleNemoDeleteOutputBuilder base) {
+            message = base.message;
+            resultCode = base.resultCode;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(message, resultCode, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            StructureStyleNemoDeleteOutputImpl other =
+                    (StructureStyleNemoDeleteOutputImpl) obj;
+            return Objects.equals(message, other.getMessage()) &&
+                    Objects.equals(resultCode, other.getResultCode()) &&
+                    Objects.equals(augmentation, other.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("message", message)
+                    .add("resultCode", resultCode)
+                    .add("augmentation", augmentation).toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoUpdateOutput.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoUpdateOutput.java
new file mode 100644
index 0000000..a47cfb8
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoUpdateOutput.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+/**
+ * Representation of structure style update output.
+ */
+public interface StructureStyleNemoUpdateOutput extends DefaultOutput {
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoUpdateOutputBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoUpdateOutputBuilder.java
new file mode 100644
index 0000000..49c3449
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/StructureStyleNemoUpdateOutputBuilder.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+/**
+ * Representation of the structure style update output builder.
+ */
+public class StructureStyleNemoUpdateOutputBuilder extends DefaultOutputBuilderBase {
+
+    private Map<Class<? extends StructureStyleNemoUpdateOutput>,
+            StructureStyleNemoUpdateOutput>
+            augmentation = new HashMap<>();
+
+    /**
+     * Constructs a structure style update output builder.
+     */
+    public StructureStyleNemoUpdateOutputBuilder() {
+    }
+
+    /**
+     * Constructs a structure style update output builder
+     * from a RPC result.
+     *
+     * @param rpc common RPC result
+     */
+    public StructureStyleNemoUpdateOutputBuilder(CommonRpcResult rpc) {
+        resultCode = rpc.getResultCode();
+        message = rpc.getMessage();
+    }
+
+    /**
+     * Constructs structure style update output builder from
+     * a structure style update output object.
+     *
+     * @param base structure style update output object
+     */
+    public StructureStyleNemoUpdateOutputBuilder(
+            StructureStyleNemoUpdateOutput base) {
+        message = base.getMessage();
+        resultCode = base.getResultCode();
+        if (base instanceof StructureStyleNemoUpdateOutputImpl) {
+            StructureStyleNemoUpdateOutputImpl impl = (StructureStyleNemoUpdateOutputImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Adds augmentation by a class type and a structure style update output.
+     * If the augmentation is null, remove the augmentation type key from
+     * the hash map.
+     *
+     * @param augmentationType type that extends StructureStyleNemoUpdateOutput
+     * @param augmentation StructureStyleNemoUpdateOutput object
+     * @return self
+     */
+    public StructureStyleNemoUpdateOutputBuilder addAugmentation(
+            Class<? extends StructureStyleNemoUpdateOutput> augmentationType,
+            StructureStyleNemoUpdateOutput augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Removes augmentation by a class type.
+     *
+     * @param augmentationType type that extends StructureStyleNemoUpdateOutput
+     * @return self
+     */
+    public StructureStyleNemoUpdateOutputBuilder removeAugmentation(
+            Class<? extends StructureStyleNemoUpdateOutput> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds the structure style update output object.
+     *
+     * @return the structure style update output object
+     */
+    public StructureStyleNemoUpdateOutput build() {
+        return new StructureStyleNemoUpdateOutputImpl(this);
+    }
+
+    /**
+     * Representation of the implement of StructureStyleNemoUpdateOutput.
+     */
+    private static final class StructureStyleNemoUpdateOutputImpl
+            extends DefaultOutputImplBase
+            implements StructureStyleNemoUpdateOutput {
+
+        private final Map<Class<? extends StructureStyleNemoUpdateOutput>,
+                StructureStyleNemoUpdateOutput> augmentation;
+
+        private StructureStyleNemoUpdateOutputImpl(
+                StructureStyleNemoUpdateOutputBuilder base) {
+            message = base.message;
+            resultCode = base.resultCode;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(message, resultCode, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            StructureStyleNemoUpdateOutputImpl other =
+                    (StructureStyleNemoUpdateOutputImpl) obj;
+            return Objects.equals(message, other.getMessage()) &&
+                    Objects.equals(resultCode, other.getResultCode()) &&
+                    Objects.equals(augmentation, other.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("message", message)
+                    .add("resultCode", resultCode)
+                    .add("augmentation", augmentation).toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/package-info.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/package-info.java
new file mode 100644
index 0000000..763e922
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Intent classes for NEMO model.
+ */
+package org.onosproject.nemo.model.intent;
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/Objects.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/Objects.java
new file mode 100644
index 0000000..a418882
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/Objects.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent.structure.style.nemo.delete.input;
+
+import org.onosproject.nemo.model.common.ConnectionId;
+import org.onosproject.nemo.model.common.FlowId;
+import org.onosproject.nemo.model.common.NodeId;
+
+import java.util.List;
+
+/**
+ * Representation of objects.
+ */
+public interface Objects {
+
+    /**
+     * Returns a list of node identifiers.
+     *
+     * @return the list of node IDs
+     */
+    List<NodeId> getNodeIds();
+
+    /**
+     * Returns a list of connection identifiers.
+     *
+     * @return the list of connection IDs
+     */
+    List<ConnectionId> getConnectionIds();
+
+    /**
+     * Returns a list of flow identifiers.
+     *
+     * @return the list of flow IDs
+     */
+    List<FlowId> getFlowIds();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/ObjectsBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/ObjectsBuilder.java
new file mode 100644
index 0000000..493552f
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/ObjectsBuilder.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent.structure.style.nemo.delete.input;
+
+import org.onosproject.nemo.model.common.ConnectionId;
+import org.onosproject.nemo.model.common.FlowId;
+import org.onosproject.nemo.model.common.NodeId;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Representation of objects builder.
+ */
+public class ObjectsBuilder {
+
+    private Map<Class<? extends Objects>, Objects> augmentation = new HashMap<>();
+
+    private List<ConnectionId> connectionIds;
+
+    private List<FlowId> flowIds;
+
+    private List<NodeId> nodeIds;
+
+    /**
+     * Constructs an objects builder.
+     */
+    public ObjectsBuilder() {
+    }
+
+    /**
+     * Constructs an objects builder from objects.
+     *
+     * @param base objects
+     */
+    public ObjectsBuilder(Objects base) {
+        connectionIds = base.getConnectionIds();
+        flowIds = base.getFlowIds();
+        nodeIds = base.getNodeIds();
+        if (base instanceof ObjectsImpl) {
+            ObjectsImpl impl = (ObjectsImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                this.augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Sets the connection ID list for the builder to use.
+     *
+     * @param value list of connection ID to set
+     * @return self
+     */
+    public ObjectsBuilder connectionIds(List<ConnectionId> value) {
+        connectionIds = value;
+        return this;
+    }
+
+    /**
+     * Sets the flow ID list for the builder to use.
+     *
+     * @param value list of flow ID to set
+     * @return self
+     */
+    public ObjectsBuilder flowIds(List<FlowId> value) {
+        flowIds = value;
+        return this;
+    }
+
+    /**
+     * Sets the node ID list for the builder to use.
+     *
+     * @param value list of node ID to set
+     * @return self
+     */
+    public ObjectsBuilder nodeIds(List<NodeId> value) {
+        nodeIds = value;
+        return this;
+    }
+
+    /**
+     * Adds augmentation by a class type and objects.
+     * If the augmentation is null, remove the augmentation type
+     * key from the hash map.
+     *
+     * @param augmentationType class extends Objects
+     * @param augmentation the objects
+     * @return self
+     */
+    public ObjectsBuilder addAugmentation(
+            Class<? extends Objects> augmentationType, Objects augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Removes augmentation with a class type.
+     *
+     * @param augmentationType a class type extends Objects
+     * @return self
+     */
+    public ObjectsBuilder removeAugmentation(
+            Class<? extends Objects> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds objects.
+     *
+     * @return objects
+     */
+    public Objects build() {
+        return new ObjectsImpl(this);
+    }
+
+    /**
+     * Representation of the implement of Objects.
+     */
+    private static final class ObjectsImpl implements Objects {
+
+        private final List<ConnectionId> connectionIds;
+        private final List<FlowId> flowIds;
+        private final List<NodeId> nodeIds;
+
+        private final Map<Class<? extends Objects>, Objects> augmentation;
+
+        private ObjectsImpl(ObjectsBuilder builder) {
+            connectionIds = new ArrayList<>(builder.connectionIds);
+            flowIds = new ArrayList<>(builder.flowIds);
+            nodeIds = new ArrayList<>(builder.nodeIds);
+            augmentation = new HashMap<>(builder.augmentation);
+        }
+
+        @Override
+        public List<ConnectionId> getConnectionIds() {
+            return new ArrayList<>(connectionIds);
+        }
+
+        @Override
+        public List<FlowId> getFlowIds() {
+            return new ArrayList<>(flowIds);
+        }
+
+        @Override
+        public List<NodeId> getNodeIds() {
+            return new ArrayList<>(nodeIds);
+        }
+
+        @Override
+        public int hashCode() {
+            return java.util.Objects.hash(connectionIds, flowIds, nodeIds, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            ObjectsImpl o = (ObjectsImpl) obj;
+            return java.util.Objects.equals(connectionIds, o.getConnectionIds()) &&
+                    java.util.Objects.equals(flowIds, o.getFlowIds()) &&
+                    java.util.Objects.equals(nodeIds, o.getNodeIds()) &&
+                    java.util.Objects.equals(augmentation, o.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("connection", connectionIds)
+                    .add("flow", flowIds)
+                    .add("node", nodeIds)
+                    .add("augmentation", augmentation).toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/Operations.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/Operations.java
new file mode 100644
index 0000000..6d90a98
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/Operations.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent.structure.style.nemo.delete.input;
+
+import org.onosproject.nemo.model.common.OperationId;
+
+import java.util.List;
+
+/**
+ * Representation of the operations.
+ */
+public interface Operations {
+
+    /**
+     * Returns a list of operation identifiers.
+     *
+     * @return the list of operation IDs
+     */
+    List<OperationId> getOperationIds();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/OperationsBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/OperationsBuilder.java
new file mode 100644
index 0000000..09a6e68
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/OperationsBuilder.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent.structure.style.nemo.delete.input;
+
+import org.onosproject.nemo.model.common.OperationId;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * Representation of operations builder.
+ */
+public class OperationsBuilder {
+
+    private Map<Class<? extends Operations>, Operations> augmentation = new HashMap<>();
+    private List<OperationId> operationIds;
+
+    /**
+     * Constructs an operations builder.
+     */
+    public OperationsBuilder() {
+    }
+
+    /**
+     * Constructs an operations builder from operations.
+     *
+     * @param base operations
+     */
+    public OperationsBuilder(Operations base) {
+        operationIds = base.getOperationIds();
+        if (base instanceof OperationsImpl) {
+            OperationsImpl impl = (OperationsImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                this.augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Sets the operation ID list for the builder to use.
+     *
+     * @param value list of operation ID to set
+     * @return self
+     */
+    public OperationsBuilder operationIds(List<OperationId> value) {
+        operationIds = value;
+        return this;
+    }
+
+    /**
+     * Adds augmentation by a class type and operations.
+     * If the augmentation is null, remove the augmentation type
+     * key from the hash map.
+     *
+     * @param augmentationType class extends Operations
+     * @param augmentation the operations
+     * @return self
+     */
+    public OperationsBuilder addAugmentation(
+            Class<? extends Operations> augmentationType, Operations augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Remove augmentation with a class type.
+     *
+     * @param augmentationType a class type extends Operations
+     * @return self
+     */
+    public OperationsBuilder removeAugmentation(Class<? extends Operations> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds operations.
+     *
+     * @return operations
+     */
+    public Operations build() {
+        return new OperationsImpl(this);
+    }
+
+    /**
+     * Representation of the implement of Operations.
+     */
+    private static final class OperationsImpl implements Operations {
+
+        private final List<OperationId> operationIds;
+        private final Map<Class<? extends Operations>, Operations> augmentation;
+
+        private OperationsImpl(OperationsBuilder builder) {
+            operationIds = new ArrayList<>(builder.operationIds);
+            augmentation = new HashMap<>(builder.augmentation);
+        }
+
+        @Override
+        public List<OperationId> getOperationIds() {
+            return new ArrayList<>(operationIds);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(operationIds, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            OperationsImpl o = (OperationsImpl) obj;
+            return Objects.equals(operationIds, o.getOperationIds()) &&
+                    Objects.equals(augmentation, o.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("operation", operationIds)
+                    .add("augmentation", augmentation).toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/package-info.java b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/package-info.java
new file mode 100644
index 0000000..a2e0ee9
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Delete input classes for NEMO model.
+ */
+package org.onosproject.nemo.model.intent.structure.style.nemo.delete.input;
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ActionDefinitions.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ActionDefinitions.java
new file mode 100644
index 0000000..9f3cf78
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ActionDefinitions.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation;
+
+import java.util.List;
+
+import org.onosproject.nemo.model.operation.action.definitions.ActionDefinition;
+
+/**
+ * The definition of a group of actions.
+ */
+public interface ActionDefinitions {
+
+    /**
+     * Returns a group of action definitions.
+     *
+     * @return the list of action definitions
+     */
+    List<ActionDefinition> getActionDefinitions();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ActionDefinitionsBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ActionDefinitionsBuilder.java
new file mode 100644
index 0000000..039dc92
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ActionDefinitionsBuilder.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import org.onosproject.nemo.model.operation.action.definitions.ActionDefinition;
+
+/**
+ * Representation of building an action definitions.
+ */
+public class ActionDefinitionsBuilder {
+
+    private Map<Class<? extends ActionDefinitions>, ActionDefinitions>
+            augmentation = new HashMap<>();
+    private List<ActionDefinition> actionDefinition;
+
+    /**
+     * Creates a default action definitions builder.
+     */
+    public ActionDefinitionsBuilder() {
+    }
+
+    /**
+     * Creates an action definitions builder from a given action definitions.
+     *
+     * @param base the action definitions
+     */
+    public ActionDefinitionsBuilder(ActionDefinitions base) {
+        actionDefinition = base.getActionDefinitions();
+        if (base instanceof ActionDefinitionsImpl) {
+            ActionDefinitionsImpl impl = (ActionDefinitionsImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Sets the action definition to be used by the builder.
+     *
+     * @param definition action definition
+     * @return self
+     */
+    public ActionDefinitionsBuilder actionDefinitions(
+            List<ActionDefinition> definition) {
+        actionDefinition = definition;
+        return this;
+    }
+
+    /**
+     * Adds an augmentation to the augmentation list. If the given augmentation
+     * is null, then removes the augmentation type from the map.
+     *
+     * @param augmentationType the type of argumentation
+     * @param augmentation the augmentation
+     * @return self
+     */
+    public ActionDefinitionsBuilder addAugmentation(
+            Class<? extends ActionDefinitions> augmentationType,
+            ActionDefinitions augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation = new HashMap<>();
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Deletes an augmentation from the augmentation list.
+     *
+     * @param augmentationType the type of argumentation
+     * @return self
+     */
+    public ActionDefinitionsBuilder removeAugmentation(
+            Class<? extends ActionDefinitions> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds an action definitions from this builder instance.
+     *
+     * @return action definitions
+     */
+    public ActionDefinitions build() {
+        return new ActionDefinitionsImpl(this);
+    }
+
+    /**
+     * The implementation of action definitions.
+     */
+    private static final class ActionDefinitionsImpl
+            implements ActionDefinitions {
+
+        private final List<ActionDefinition> actionDefinition;
+        private final Map<Class<? extends ActionDefinitions>,
+                ActionDefinitions> augmentation;
+
+        private ActionDefinitionsImpl(ActionDefinitionsBuilder base) {
+            actionDefinition = base.actionDefinition;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public List<ActionDefinition> getActionDefinitions() {
+            return actionDefinition;
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(actionDefinition, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            ActionDefinitions other = (ActionDefinitions) obj;
+            if (!Objects.equals(actionDefinition,
+                    other.getActionDefinitions())) {
+                return false;
+            }
+            ActionDefinitionsImpl otherImpl = (ActionDefinitionsImpl) obj;
+            return Objects.equals(augmentation, otherImpl.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("actionDefinition", actionDefinition)
+                    .add("augmentation", augmentation)
+                    .toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ConditionParameterDefinitions.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ConditionParameterDefinitions.java
new file mode 100644
index 0000000..7c0b3e9
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ConditionParameterDefinitions.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation;
+
+import org.onosproject.nemo.model.operation.condition.parameter.definitions.ConditionParameterDefinition;
+
+import java.util.List;
+
+/**
+ * The definition of a group of condition parameter.
+ */
+public interface ConditionParameterDefinitions {
+
+    /**
+     * Returns a group of condition parameter.
+     *
+     * @return the list of condition parameter
+     */
+    List<ConditionParameterDefinition> getDefinitions();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ConditionParameterDefinitionsBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ConditionParameterDefinitionsBuilder.java
new file mode 100644
index 0000000..4cdf1ef
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/ConditionParameterDefinitionsBuilder.java
@@ -0,0 +1,170 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import org.onosproject.nemo.model.operation.condition.parameter.definitions.ConditionParameterDefinition;
+
+/**
+ * Representation of building a condition parameter definitions.
+ */
+public class ConditionParameterDefinitionsBuilder {
+
+    private Map<Class<? extends ConditionParameterDefinitions>,
+            ConditionParameterDefinitions> augmentation = new HashMap<>();
+    private List<ConditionParameterDefinition> conditionParameterDefinition;
+
+    /**
+     * Creates a default condition parameter definitions builder.
+     */
+    public ConditionParameterDefinitionsBuilder() {
+    }
+
+    /**
+     * Creates a action definitions builder from a given
+     * condition parameter definitions.
+     *
+     * @param base the condition parameter definitions
+     * @throws ClassCastException if the given class can not cast
+     */
+    public ConditionParameterDefinitionsBuilder(
+            ConditionParameterDefinitions base) {
+        conditionParameterDefinition = base.getDefinitions();
+        if (base instanceof ConditionParameterDefinitions) {
+            ConditionParameterDefinitionsImpl impl =
+                    (ConditionParameterDefinitionsImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Sets the condition parameter definitions to be used by the builder.
+     *
+     * @param definition condition parameter definitions
+     * @return self
+     */
+    public ConditionParameterDefinitionsBuilder conditionParameterDefinitions(
+                    List<ConditionParameterDefinition> definition) {
+        conditionParameterDefinition = definition;
+        return this;
+    }
+
+    /**
+     * Adds an augmentation to the augmentation list. If the given augmentation
+     * is null, then removes the augmentation type from the map.
+     *
+     * @param augmentationType the type of argumentation
+     * @param augmentation the augmentation
+     * @return self
+     */
+    public ConditionParameterDefinitionsBuilder addAugmentation(
+            Class<? extends ConditionParameterDefinitions> augmentationType,
+            ConditionParameterDefinitions augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Deletes an augmentation from the augmentation list.
+     *
+     * @param augmentationType the type of argumentation
+     * @return self
+     */
+    public ConditionParameterDefinitionsBuilder removeAugmentation(
+            Class<? extends ConditionParameterDefinitions> augmentationType) {
+        this.augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds a condition parameter definitions from this builder instance.
+     *
+     * @return condition parameter definitions
+     */
+    public ConditionParameterDefinitions build() {
+        return new ConditionParameterDefinitionsImpl(this);
+    }
+
+    /**
+     * The implementation of condition parameter definitions.
+     */
+    private static final class ConditionParameterDefinitionsImpl implements
+            ConditionParameterDefinitions {
+
+        private final List<ConditionParameterDefinition>
+                conditionParameterDefinition;
+        private final Map<Class<? extends ConditionParameterDefinitions>,
+                ConditionParameterDefinitions> augmentation;
+
+        private ConditionParameterDefinitionsImpl(
+                ConditionParameterDefinitionsBuilder base) {
+            conditionParameterDefinition = base.conditionParameterDefinition;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public List<ConditionParameterDefinition> getDefinitions() {
+            return conditionParameterDefinition;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            ConditionParameterDefinitions other =
+                    (ConditionParameterDefinitions) obj;
+            if (!Objects.equals(conditionParameterDefinition,
+                    other.getDefinitions())) {
+                return false;
+            }
+            ConditionParameterDefinitionsImpl otherImpl =
+                    (ConditionParameterDefinitionsImpl) obj;
+            return Objects.equals(augmentation, otherImpl.augmentation);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(conditionParameterDefinition, augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("conditionParameterDefinition",
+                            conditionParameterDefinition)
+                    .add("augmentation", augmentation)
+                    .toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/NemoOperationData.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/NemoOperationData.java
new file mode 100644
index 0000000..f89d59d
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/NemoOperationData.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation;
+
+/**
+ * All NEMO operation data's description.
+ */
+public interface NemoOperationData {
+
+    /**
+     * Returns all condition parameter definitions.
+     *
+     * @return condition parameter definitions
+     */
+    ConditionParameterDefinitions getConditionParameterDefinitions();
+
+    /**
+     * Returns all action definitions.
+     *
+     * @return action definitions
+     */
+    ActionDefinitions getActionDefinitions();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinition.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinition.java
new file mode 100644
index 0000000..a32b9fa
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinition.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation.action.definitions;
+
+import static com.google.common.collect.ImmutableMap.builder;
+
+import java.util.Map;
+
+import org.onosproject.nemo.model.common.ActionName;
+
+import com.google.common.collect.ImmutableMap.Builder;
+
+/**
+ * The definition of an action.
+ */
+public interface ActionDefinition {
+
+    /**
+     * Returns the name of an action definition.
+     *
+     * @return the action name
+     */
+    ActionName getActionName();
+
+    /**
+     * Returns the type of a parameter value.
+     *
+     * @return the type
+     */
+    ParameterValueType getParameterValueType();
+
+    /**
+     * Returns the primary key of YANG type list.
+     *
+     * @return the action definition key
+     */
+    ActionDefinitionKey getKey();
+
+    /**
+     * Types of parameter value.
+     */
+    enum ParameterValueType {
+
+        /** A string-valued parameter. */
+        STRING(0),
+
+        /** An integer-valued parameter. */
+        INT(1),
+
+        /** An integer-range parameter. */
+        RANGE(2);
+
+        private static final Map<Integer, ParameterValueType> VALUE_MAP;
+
+        int value;
+
+        ParameterValueType(int value) {
+            this.value = value;
+        }
+
+        /**
+         * Returns the value of this action definition.
+         *
+         * @return the value
+         */
+        public int getIntValue() {
+            return value;
+        }
+
+        static {
+            Builder<Integer, ParameterValueType> b = builder();
+            for (ParameterValueType enumItem : ParameterValueType.values()) {
+                b.put(enumItem.value, enumItem);
+            }
+            VALUE_MAP = b.build();
+        }
+
+        /**
+         * Returns the type from the given parameter value.
+         *
+         * @param value the given value
+         * @return corresponding type constant
+         * @throws IllegalArgumentException if there is no mapping
+         */
+        public static ParameterValueType forValue(int value) {
+            ParameterValueType type = VALUE_MAP.get(value);
+            if (type == null) {
+                throw new IllegalArgumentException();
+            }
+            return type;
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionBuilder.java
new file mode 100644
index 0000000..a949a78
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionBuilder.java
@@ -0,0 +1,220 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation.action.definitions;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import org.onosproject.nemo.model.common.ActionName;
+
+/**
+ * Representation of building an action definition.
+ */
+public class ActionDefinitionBuilder {
+
+    private Map<Class<? extends ActionDefinition>, ActionDefinition>
+            augmentation = new HashMap<>();
+    private ActionName actionName;
+    private ActionDefinitionKey key;
+    private ActionDefinition.ParameterValueType pvType;
+
+    /**
+     * Creates a default action definition builder.
+     */
+    public ActionDefinitionBuilder() {
+    }
+
+    /**
+     * Creates an action definition builder from a given action definition.
+     *
+     * @param base the action definition
+     */
+    public ActionDefinitionBuilder(ActionDefinition base) {
+        if (base.getKey() == null) {
+            key = new ActionDefinitionKey(base.getActionName());
+            actionName = base.getActionName();
+        } else {
+            key = base.getKey();
+            actionName = key.getActionName();
+        }
+        pvType = base.getParameterValueType();
+        if (base instanceof ActionDefinitionImpl) {
+            ActionDefinitionImpl impl = (ActionDefinitionImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Sets the action name to be used by the builder.
+     *
+     * @param name the action name
+     * @return self
+     */
+    public ActionDefinitionBuilder actionName(ActionName name) {
+        actionName = name;
+        return this;
+    }
+
+    /**
+     * Sets the action definition key to be used by the builder.
+     *
+     * @param key action definition key
+     * @return self
+     */
+    public ActionDefinitionBuilder key(ActionDefinitionKey key) {
+        this.key = key;
+        return this;
+    }
+
+    /**
+     * Sets the parameter value type to be used by the builder.
+     *
+     * @param type parameter value type
+     * @return self
+     */
+    public ActionDefinitionBuilder parameterValueType(
+            ActionDefinition.ParameterValueType type) {
+        pvType = type;
+        return this;
+    }
+
+    /**
+     * Adds an augmentation to the augmentation list. If the given augmentation
+     * is null, then removes the augmentation type from the map.
+     *
+     * @param augmentationType the type of argumentation
+     * @param augmentation the augmentation
+     * @return self
+     */
+    public ActionDefinitionBuilder addAugmentation(
+            Class<? extends ActionDefinition> augmentationType,
+            ActionDefinition augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Deletes an augmentation from the augmentation list.
+     *
+     * @param augmentationType the type of argumentation
+     * @return self
+     */
+    public ActionDefinitionBuilder removeAugmentation(
+            Class<? extends ActionDefinition> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds an action definition from this builder instance.
+     *
+     * @return action definition
+     */
+    public ActionDefinition build() {
+        return new ActionDefinitionImpl(this);
+    }
+
+    /**
+     * The implementation of action definition.
+     */
+    private static final class ActionDefinitionImpl
+            implements ActionDefinition {
+
+        private final ActionName actionName;
+        private final ActionDefinitionKey key;
+        private final ParameterValueType parameterValueType;
+        private final Map<Class<? extends ActionDefinition>, ActionDefinition>
+                augmentation;
+
+        private ActionDefinitionImpl(ActionDefinitionBuilder base) {
+            if (base.key == null) {
+                key = new ActionDefinitionKey(base.actionName);
+                actionName = base.actionName;
+            } else {
+                key = base.key;
+                actionName = key.getActionName();
+            }
+            parameterValueType = base.pvType;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public ActionName getActionName() {
+            return actionName;
+        }
+
+        @Override
+        public ActionDefinitionKey getKey() {
+            return key;
+        }
+
+        @Override
+        public ParameterValueType getParameterValueType() {
+            return parameterValueType;
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(actionName, key, parameterValueType, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            ActionDefinition other = (ActionDefinition) obj;
+            if (!Objects.equals(actionName,
+                    other.getActionName())) {
+                return false;
+            }
+            if (!Objects.equals(key,
+                    other.getKey())) {
+                return false;
+            }
+            if (!Objects.equals(parameterValueType,
+                    other.getParameterValueType())) {
+                return false;
+            }
+            ActionDefinitionImpl otherImpl = (ActionDefinitionImpl) obj;
+            return Objects.equals(augmentation, otherImpl.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("actionName", actionName)
+                    .add("key", key)
+                    .add("parameterValueType", parameterValueType)
+                    .add("augmentation", augmentation)
+                    .toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionKey.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionKey.java
new file mode 100644
index 0000000..aacd456
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionKey.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation.action.definitions;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.Objects;
+
+import org.onosproject.nemo.model.common.ActionName;
+
+/**
+ * The key to action definition.
+ */
+public class ActionDefinitionKey {
+
+    private final ActionName actionName;
+
+    /**
+     * Creates an action definition key from a given action name.
+     *
+     * @param actionName the action name
+     */
+    public ActionDefinitionKey(ActionName actionName) {
+        this.actionName = actionName;
+    }
+
+    /**
+     * Creates a copy from a given action definition key.
+     *
+     * @param key the action definition key
+     */
+    public ActionDefinitionKey(ActionDefinitionKey key) {
+        actionName = key.actionName;
+    }
+
+    /**
+     * Returns the action name of this instance.
+     *
+     * @return the action name
+     */
+    public ActionName getActionName() {
+        return actionName;
+    }
+
+    @Override
+    public int hashCode() {
+        return actionName.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        ActionDefinitionKey other = (ActionDefinitionKey) obj;
+        return Objects.equals(actionName, other.actionName);
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this)
+                .add("actionName", actionName)
+                .toString();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/package-info.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/package-info.java
new file mode 100644
index 0000000..49839ff
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/definitions/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Action definition classes for NEMO model.
+ */
+package org.onosproject.nemo.model.operation.action.definitions;
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/package-info.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/package-info.java
new file mode 100644
index 0000000..aea81db
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/action/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Operation action description classes for NEMO model.
+ */
+package org.onosproject.nemo.model.operation.action;
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/package-info.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/package-info.java
new file mode 100644
index 0000000..a23cf12
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Operation condition classes for NEMO model.
+ */
+package org.onosproject.nemo.model.operation.condition;
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinition.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinition.java
new file mode 100644
index 0000000..8987857
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinition.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation.condition.parameter.definitions;
+
+import static com.google.common.collect.ImmutableMap.builder;
+
+import java.util.Map;
+
+import org.onosproject.nemo.model.common.ParameterName;
+import org.onosproject.nemo.model.operation.condition.parameter.definitions.condition.parameter.definition.ParameterMatchPatterns;
+
+import com.google.common.collect.ImmutableMap.Builder;
+
+/**
+ * The definition of a condition parameter.
+ */
+public interface ConditionParameterDefinition {
+
+    /**
+     * Returns the name of an parameter definition.
+     *
+     * @return the parameter name
+     */
+    ParameterName getParameterName();
+
+    /**
+     * Returns the type of a parameter value.
+     *
+     * @return the type
+     */
+    ParameterValueType getParameterValueType();
+
+    /**
+     * Returns the parameter match patterns.
+     *
+     * @return the patterns
+     */
+    ParameterMatchPatterns getParameterMatchPatterns();
+
+    /**
+     * Returns the primary key of YANG type list.
+     *
+     * @return the action definition key
+     */
+    ConditionParameterDefinitionKey getKey();
+
+    /**
+     * Types of parameter value.
+     */
+    enum ParameterValueType {
+        /** A string-valued parameter. */
+        STRING(0),
+
+        /** An integer-valued parameter. */
+        INT(1),
+
+        /** An integer-range parameter. */
+        RANGE(2);
+
+        private static final Map<Integer, ParameterValueType> VALUE_MAP;
+
+        int value;
+
+        ParameterValueType(int value) {
+            this.value = value;
+        }
+
+        /**
+         * Returns the value of this definition.
+         *
+         * @return the value
+         */
+        public int getIntValue() {
+            return value;
+        }
+
+        static {
+            Builder<Integer, ParameterValueType> b = builder();
+            for (ParameterValueType enumItem : ParameterValueType.values()) {
+                b.put(enumItem.value, enumItem);
+            }
+            VALUE_MAP = b.build();
+        }
+
+        /**
+         * Returns the type from the given value.
+         *
+         * @param value the given value
+         * @return corresponding type constant
+         * @throws IllegalArgumentException if there is no mapping
+         */
+        public static ParameterValueType forValue(int value) {
+            ParameterValueType type = VALUE_MAP.get(value);
+            if (type == null) {
+                throw new IllegalArgumentException();
+            }
+            return type;
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionBuilder.java
new file mode 100644
index 0000000..7eadd84
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionBuilder.java
@@ -0,0 +1,250 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation.condition.parameter.definitions;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import org.onosproject.nemo.model.common.ParameterName;
+import org.onosproject.nemo.model.operation.condition.parameter.definitions.condition.parameter.definition.ParameterMatchPatterns;
+
+/**
+ * Representation of building a condition parameter definition.
+ */
+public class ConditionParameterDefinitionBuilder {
+
+    private Map<Class<? extends ConditionParameterDefinition>,
+            ConditionParameterDefinition> augmentation = new HashMap<>();
+    private ConditionParameterDefinitionKey key;
+    private ParameterMatchPatterns parameterMatchPatterns;
+    private ParameterName parameterName;
+    private ConditionParameterDefinition.ParameterValueType parameterValueType;
+
+    /**
+     * Creates a default condition parameter definition builder.
+     */
+    public ConditionParameterDefinitionBuilder() {
+    }
+
+    /**
+     * Creates a condition parameter builder from a given condition parameter
+     * definition.
+     *
+     * @param base the condition parameter definition
+     */
+    public ConditionParameterDefinitionBuilder(
+            ConditionParameterDefinition base){
+        if (base.getKey() == null) {
+            key = new ConditionParameterDefinitionKey(base.getParameterName());
+            parameterName = base.getParameterName();
+        } else {
+            key = base.getKey();
+            parameterName = key.getParameterName();
+        }
+        parameterMatchPatterns = base.getParameterMatchPatterns();
+        parameterValueType = base.getParameterValueType();
+        if (base instanceof ConditionParameterDefinitionImpl) {
+            ConditionParameterDefinitionImpl impl =
+                    (ConditionParameterDefinitionImpl) base;
+            if (!impl.augmentation.isEmpty()) {
+                this.augmentation = new HashMap<>(impl.augmentation);
+            }
+        }
+    }
+
+    /**
+     * Sets the condition parameter definition key to be used by the builder.
+     *
+     * @param key condition parameter definition key
+     * @return self
+     */
+    public ConditionParameterDefinitionBuilder key(
+            ConditionParameterDefinitionKey key) {
+        this.key = key;
+        return this;
+    }
+
+    /**
+     * Sets the condition parameter match patterns to be used by the builder.
+     *
+     * @param patterns condition parameter match patterns
+     * @return self
+     */
+    public ConditionParameterDefinitionBuilder parameterMatchPatterns(
+            ParameterMatchPatterns patterns) {
+        parameterMatchPatterns = patterns;
+        return this;
+    }
+
+    /**
+     * Sets the parameter name to be used by the builder.
+     *
+     * @param name the parameter name
+     * @return self
+     */
+    public ConditionParameterDefinitionBuilder parameterName(
+            ParameterName name) {
+        parameterName = name;
+        return this;
+    }
+
+    /**
+     * Sets the parameter value type to be used by the builder.
+     *
+     * @param type parameter value type
+     * @return self
+     */
+    public ConditionParameterDefinitionBuilder parameterValueType(
+            ConditionParameterDefinition.ParameterValueType type) {
+        parameterValueType = type;
+        return this;
+    }
+
+    /**
+     * Adds an augmentation to the augmentation list. If the given augmentation
+     * is null, then removes the augmentation type from the map.
+     *
+     * @param augmentationType the type of argumentation
+     * @param augmentation the augmentation
+     * @return self
+     */
+    public ConditionParameterDefinitionBuilder addAugmentation(
+            Class<? extends ConditionParameterDefinition> augmentationType,
+            ConditionParameterDefinition augmentation) {
+        if (augmentation == null) {
+            return removeAugmentation(augmentationType);
+        }
+        this.augmentation.put(augmentationType, augmentation);
+        return this;
+    }
+
+    /**
+     * Deletes an augmentation from the augmentation list.
+     *
+     * @param augmentationType the type of argumentation
+     * @return self
+     */
+    public ConditionParameterDefinitionBuilder removeAugmentation(
+            Class<? extends ConditionParameterDefinition> augmentationType) {
+        augmentation.remove(augmentationType);
+        return this;
+    }
+
+    /**
+     * Builds a condition parameter definition from this builder instance.
+     *
+     * @return condition parameter definition
+     */
+    public ConditionParameterDefinition build() {
+        return new ConditionParameterDefinitionImpl(this);
+    }
+
+    /**
+     * The implementation of condition parameter definition.
+     */
+    private static final class ConditionParameterDefinitionImpl
+            implements ConditionParameterDefinition {
+
+        private final ConditionParameterDefinitionKey key;
+        private final ParameterMatchPatterns parameterMatchPatterns;
+        private final ParameterName parameterName;
+        private final ParameterValueType parameterValueType;
+        private final Map<Class<? extends ConditionParameterDefinition>,
+                ConditionParameterDefinition> augmentation;
+
+        private ConditionParameterDefinitionImpl(
+                ConditionParameterDefinitionBuilder base) {
+            if (base.key == null) {
+                key = new ConditionParameterDefinitionKey(base.parameterName);
+                parameterName = base.parameterName;
+            } else {
+                key = base.key;
+                parameterName = key.getParameterName();
+            }
+            parameterMatchPatterns = base.parameterMatchPatterns;
+            parameterValueType = base.parameterValueType;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public ConditionParameterDefinitionKey getKey() {
+            return key;
+        }
+
+        @Override
+        public ParameterMatchPatterns getParameterMatchPatterns() {
+            return parameterMatchPatterns;
+        }
+
+        @Override
+        public ParameterName getParameterName() {
+            return parameterName;
+        }
+
+        @Override
+        public ParameterValueType getParameterValueType() {
+            return parameterValueType;
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(key, parameterMatchPatterns,
+                    parameterName, parameterValueType, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if( obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            ConditionParameterDefinition other = (ConditionParameterDefinition) obj;
+            if (!Objects.equals(key, other.getKey())) {
+                return false;
+            }
+            if (!Objects.equals(parameterMatchPatterns, other.getParameterMatchPatterns())) {
+                return false;
+            }
+            if (!Objects.equals(parameterName, other.getParameterName())) {
+                return false;
+            }
+            if (!Objects.equals(parameterValueType, other.getParameterValueType())) {
+                return false;
+            }
+            ConditionParameterDefinitionImpl otherImpl = (ConditionParameterDefinitionImpl) obj;
+            return Objects.equals(augmentation, otherImpl.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("key", key)
+                    .add("parameterMatchPatterns", parameterMatchPatterns)
+                    .add("parameterName", parameterName)
+                    .add("parameterValueType", parameterValueType)
+                    .add("augmentation", augmentation)
+                    .toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionKey.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionKey.java
new file mode 100644
index 0000000..d0d787c
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionKey.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation.condition.parameter.definitions;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.Objects;
+
+import org.onosproject.nemo.model.common.ParameterName;
+
+/**
+ * The key to condition parameter definition.
+ */
+public class ConditionParameterDefinitionKey {
+
+    private final ParameterName parameterName;
+
+    /**
+     * Creates a condition parameter definition from a given parameter name.
+     *
+     * @param parameterName the parameter name
+     */
+    public ConditionParameterDefinitionKey(ParameterName parameterName) {
+        this.parameterName = parameterName;
+    }
+
+    /**
+     * Creates a copy from a given condition parameter definition key.
+     *
+     * @param key the condition parameter definition key
+     */
+    public ConditionParameterDefinitionKey(
+            ConditionParameterDefinitionKey key) {
+        parameterName = key.parameterName;
+    }
+
+    /**
+     * Returns the parameter name of this instance.
+     *
+     * @return the parameter name
+     */
+    public ParameterName getParameterName() {
+        return parameterName;
+    }
+
+    @Override
+    public int hashCode() {
+        return parameterName.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        ConditionParameterDefinitionKey other =
+                (ConditionParameterDefinitionKey) obj;
+        return Objects.equals(parameterName, other.parameterName);
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this)
+                .add("parameterName", parameterName)
+                .toString();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/condition/parameter/definition/ParameterMatchPatterns.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/condition/parameter/definition/ParameterMatchPatterns.java
new file mode 100644
index 0000000..7d5e123
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/condition/parameter/definition/ParameterMatchPatterns.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation.condition.parameter
+        .definitions.condition.parameter.definition;
+
+import static com.google.common.collect.ImmutableMap.builder;
+
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.collect.ImmutableMap.Builder;
+
+/**
+ * The definition of parameter match patterns.
+ */
+public interface ParameterMatchPatterns {
+
+    /**
+     * Returns the parameter match pattern.
+     *
+     * @return the parameter match pattern
+     */
+    List<ParameterMatchPattern> getParameterMatchPattern();
+
+    /**
+     * The match pattern types of the parameter.
+     */
+    enum ParameterMatchPattern {
+        /** The parameter is less than the other. */
+        LESS_THAN(0),
+
+        /** The parameter is not less than the other. */
+        NOT_LESS_THAN(1),
+
+        /** The parameter equals to the other. */
+        EQUAL(2),
+
+        /** The parameter does not equal to the other. */
+        NOT_EQUAL(3),
+
+        /** The parameter is greater than the other. */
+        GREATER_THAN(4),
+
+        /** The parameter is not greater than the other. */
+        NOT_GREATER_THAN(5),
+
+        /** The parameter is between two parameters. */
+        BETWEEN(6),
+
+        /** The parameter is periodical. */
+        PERIODICAL(7);
+
+        private static final Map<Integer, ParameterMatchPattern> VALUE_MAP;
+
+        int value;
+
+        ParameterMatchPattern(int value) {
+            this.value = value;
+        }
+
+        /**
+         * Returns the value of this parameter match pattern.
+         *
+         * @return the value
+         */
+        public int getIntValue() {
+            return value;
+        }
+
+        static {
+            Builder<Integer, ParameterMatchPattern> b = builder();
+            for (ParameterMatchPattern enumItem :
+                ParameterMatchPattern.values()) {
+                b.put(enumItem.value, enumItem);
+            }
+            VALUE_MAP = b.build();
+        }
+
+        /**
+         * Returns the parameter match pattern from the given value.
+         *
+         * @param value the given value
+         * @return the parameter match pattern
+         * @throws IllegalArgumentException if there is no mapping
+         */
+        public static ParameterMatchPattern forValue(int value) {
+            ParameterMatchPattern pattern = VALUE_MAP.get(value);
+            if (pattern == null) {
+                throw new IllegalArgumentException();
+            }
+            return pattern;
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/condition/parameter/definition/package-info.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/condition/parameter/definition/package-info.java
new file mode 100644
index 0000000..d21c478
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/condition/parameter/definition/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * The parameter definition pattern classes for NEMO model.
+ */
+package org.onosproject.nemo.model.operation.condition.parameter.
+        definitions.condition.parameter.definition;
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/package-info.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/package-info.java
new file mode 100644
index 0000000..c42f25f
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Parameter definitions classes for NEMO model which describe parameter.
+ */
+package org.onosproject.nemo.model.operation.condition.parameter.definitions;
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/operation/package-info.java b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/package-info.java
new file mode 100644
index 0000000..ade6de1
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/operation/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Operation description classes for NEMO model.
+ */
+package org.onosproject.nemo.model.operation;
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/user/NemoUserData.java b/nemoengine/src/main/java/org/onosproject/nemo/model/user/NemoUserData.java
new file mode 100644
index 0000000..e01e9ca
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/user/NemoUserData.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.user;
+
+/**
+ * All Users' information data.
+ */
+public interface NemoUserData {
+    /**
+     * Returns all user roles information.
+     *
+     * @return user roles
+     */
+    UserRoles getUserRoles();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/user/UserInstance.java b/nemoengine/src/main/java/org/onosproject/nemo/model/user/UserInstance.java
new file mode 100644
index 0000000..d9b266b
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/user/UserInstance.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.user;
+
+import org.onosproject.nemo.model.common.UserId;
+import org.onosproject.nemo.model.common.UserName;
+import org.onosproject.nemo.model.common.UserPassword;
+import org.onosproject.nemo.model.common.UserRoleName;
+
+/**
+ * User instance which contains user information.
+ */
+public interface UserInstance {
+
+    /**
+     * Returns the unique ID for a user.
+     *
+     * @return user id object
+     */
+    UserId getUserId();
+
+    /**
+     * Returns the user-visible and unique name for a user.
+     *
+     * @return user
+     */
+    UserName getUserName();
+
+    /**
+     * Returns the password of a user.
+     *
+     * @return user password
+     */
+    UserPassword getUserPassword();
+
+    /**
+     * Returns the role of a user.
+     *
+     * @return user role name
+     */
+    UserRoleName getUserRole();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/user/UserRoles.java b/nemoengine/src/main/java/org/onosproject/nemo/model/user/UserRoles.java
new file mode 100644
index 0000000..a600be5
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/user/UserRoles.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.user;
+
+import org.onosproject.nemo.model.user.roles.UserRole;
+
+import java.util.List;
+
+/**
+ * User roles' information.
+ *
+ */
+public interface UserRoles {
+
+    /**
+     * Returns a list of user roles.
+     *
+     * @return user role list
+     */
+    List<UserRole> getUserRoles();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/user/UserRolesBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/user/UserRolesBuilder.java
new file mode 100644
index 0000000..d49b406
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/user/UserRolesBuilder.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.user;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import org.onosproject.nemo.model.user.roles.UserRole;
+
+/**
+ * The builder of user roles.
+ */
+public class UserRolesBuilder {
+
+    private Map<UserRoles, UserRoles> augmentation = new HashMap<>();
+    private List<UserRole> userRoles;
+
+    /**
+     * Creates a default user roles builder.
+     */
+    public UserRolesBuilder() {
+    }
+
+    /**
+     * Creates a user roles builder from a user roles object.
+     *
+     * @param base the user roles object
+     */
+    public UserRolesBuilder(UserRoles base) {
+        userRoles = base.getUserRoles();
+    }
+
+    /**
+     * Sets the user role list to be used by the builder.
+     *
+     * @param value user role list
+     * @return self
+     */
+    public UserRolesBuilder userRoles(List<UserRole> value) {
+        userRoles = value;
+        return this;
+    }
+
+    /**
+     * Builds the user roles from this instance.
+     *
+     * @return user roles
+     */
+    public UserRoles build() {
+        return new UserRolesImpl(this);
+    }
+
+    /**
+     * The implementation of user role interface to create an instance.
+     */
+    private static final class UserRolesImpl implements UserRoles {
+
+        private final List<UserRole> userRoles;
+        private final Map<UserRoles, UserRoles> augmentation;
+
+        private UserRolesImpl(UserRolesBuilder base) {
+            userRoles = base.userRoles;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public List<UserRole> getUserRoles() {
+            return userRoles;
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(userRoles, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null){
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            UserRoles other = (UserRoles) obj;
+            if (!Objects.equals(userRoles, other.getUserRoles())) {
+                return false;
+            }
+            UserRolesImpl otherImpl = (UserRolesImpl) obj;
+            return Objects.equals(augmentation, otherImpl.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("user roles", userRoles)
+                    .add("augmentation", augmentation)
+                    .toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/user/package-info.java b/nemoengine/src/main/java/org/onosproject/nemo/model/user/package-info.java
new file mode 100644
index 0000000..3095bd9
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/user/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * User classes for NEMO model which describe users' information.
+ */
+package org.onosproject.nemo.model.user;
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/UserRole.java b/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/UserRole.java
new file mode 100644
index 0000000..4fc9fe5
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/UserRole.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.user.roles;
+
+import org.onosproject.nemo.model.common.UserRoleDescription;
+import org.onosproject.nemo.model.common.UserRoleName;
+
+/**
+ * Single User role's information.
+ */
+public interface UserRole {
+
+    /**
+     * Returns a user-visible and unique name for a kind of role.
+     *
+     * @return a user-visible and unique name
+     */
+    UserRoleName getRoleName();
+
+    /**
+     * Returns a description of the characteristic,
+     * responsibility and purpose for a kind of role.
+     *
+     * @return a description of the role
+     */
+    UserRoleDescription getRoleDescription();
+
+    /**
+     * Returns the primary key of YANG list type.
+     *
+     * @return the key
+     */
+    UserRoleKey getKey();
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/UserRoleBuilder.java b/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/UserRoleBuilder.java
new file mode 100644
index 0000000..a0696f6
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/UserRoleBuilder.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.user.roles;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import org.onosproject.nemo.model.common.UserRoleDescription;
+import org.onosproject.nemo.model.common.UserRoleName;
+
+/**
+ * The builder of user role.
+ */
+public class UserRoleBuilder {
+
+    private Map<UserRole, UserRole> augmentation = new HashMap<>();
+    private UserRoleKey key;
+    private UserRoleDescription roleDescription;
+    private UserRoleName roleName;
+
+    /**
+     * Creates a default user role builder.
+     */
+    public UserRoleBuilder() {
+    }
+
+    /**
+     * Creates a user role builder from a user role object.
+     *
+     * @param base the user role object
+     */
+    public UserRoleBuilder(UserRole base) {
+        if (base.getKey() == null) {
+            key = new UserRoleKey(base.getRoleName());
+            roleName = base.getRoleName();
+        } else {
+            key = base.getKey();
+            roleName = key.getRoleName();
+        }
+        roleDescription = base.getRoleDescription();
+    }
+
+    /**
+     * Sets the key to be used by the builder.
+     *
+     * @param key key value
+     * @return self
+     */
+    public UserRoleBuilder key(UserRoleKey key) {
+        this.key = key;
+        return this;
+    }
+
+    /**
+     * Sets the description to be used by the builder.
+     *
+     * @param desc the role description
+     * @return self
+     */
+    public UserRoleBuilder roleDescription(UserRoleDescription desc) {
+        roleDescription = desc;
+        return this;
+    }
+
+    /**
+     * Sets the role name to be used by the builder.
+     *
+     * @param name user role name
+     * @return self
+     */
+    public UserRoleBuilder roleName(UserRoleName name) {
+        roleName = name;
+        return this;
+    }
+
+    /**
+     * Builds a user role from this builder instance.
+     *
+     * @return user role
+     */
+    public UserRole build() {
+        return new UserRoleImpl(this);
+    }
+
+    /**
+     * The implementation of user role interface.
+     */
+    private static final class UserRoleImpl implements UserRole {
+
+        private final UserRoleKey key;
+        private final UserRoleDescription roleDescription;
+        private final UserRoleName roleName;
+        private final Map<UserRole, UserRole> augmentation;
+
+        private UserRoleImpl(UserRoleBuilder base) {
+            if (base.key == null) {
+                key = new UserRoleKey(base.roleName);
+                roleName = base.roleName;
+            } else {
+                key = base.key;
+                roleName = key.getRoleName();
+            }
+            roleDescription = base.roleDescription;
+            augmentation = new HashMap<>(base.augmentation);
+        }
+
+        @Override
+        public UserRoleKey getKey() {
+            return key;
+        }
+
+        @Override
+        public UserRoleDescription getRoleDescription() {
+            return roleDescription;
+        }
+
+        @Override
+        public UserRoleName getRoleName() {
+            return roleName;
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(key, roleDescription, roleName, augmentation);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            UserRole other = (UserRole) obj;
+            if (!Objects.equals(roleName, other.getRoleName())) {
+                return false;
+            }
+            if (!Objects.equals(roleDescription,
+                    other.getRoleDescription())) {
+                return false;
+            }
+            if (!Objects.equals(key, other.getKey())) {
+                return false;
+            }
+            UserRoleImpl otherImpl = (UserRoleImpl) obj;
+            return Objects.equals(augmentation, otherImpl.augmentation);
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(this)
+                    .add("key", key)
+                    .add("role description", roleDescription)
+                    .add("role name", roleName)
+                    .add("augmentation", augmentation)
+                    .toString();
+        }
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/UserRoleKey.java b/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/UserRoleKey.java
new file mode 100644
index 0000000..cd53377
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/UserRoleKey.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.user.roles;
+
+import org.onosproject.nemo.model.common.UserRoleName;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+import java.util.Objects;
+
+/**
+ * The key to differentiate user roles.
+ */
+public class UserRoleKey {
+    private final UserRoleName roleName;
+
+    /**
+     * Creates a user role key from a given role name.
+     *
+     * @param roleName the role name
+     */
+    public UserRoleKey(UserRoleName roleName) {
+        this.roleName = roleName;
+    }
+
+    /**
+     * Creates a copy from a given user role key instance.
+     *
+     * @param source the user role key
+     */
+    public UserRoleKey(UserRoleKey source) {
+        this.roleName = source.roleName;
+    }
+
+    /**
+     * Returns the user role name of this instance.
+     *
+     * @return role name
+     */
+    public UserRoleName getRoleName() {
+        return roleName;
+    }
+
+    @Override
+    public int hashCode() {
+        return roleName.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        UserRoleKey other = (UserRoleKey) obj;
+        return Objects.equals(roleName, other.roleName);
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this).add("rolename", roleName).toString();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/package-info.java b/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/package-info.java
new file mode 100644
index 0000000..ada7ed5
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/user/roles/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * User role classes for NEMO model which describe user role information.
+ */
+package org.onosproject.nemo.model.user.roles;
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/intent/BeginTransactionInputBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/BeginTransactionInputBuilderTest.java
new file mode 100644
index 0000000..5621411
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/BeginTransactionInputBuilderTest.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.UserId;
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link BeginTransactionInputBuilder}.
+ */
+public class BeginTransactionInputBuilderTest {
+
+    private static final String ID = "00000000-0000-0000-0000-000000000000";
+    private static final String OTHER_ID = "00000000-0000-0000-0000-000000000001";
+    private static final String ID_ERROR_MSG = "id not set";
+    private static final String AUGMENTATION_ERROR_MSG = "augmentation not equal";
+
+    private UserId userID;
+    private UserId otherID;
+    private BeginTransactionInput listParam;
+    private BeginTransactionInput def;
+    private BeginTransactionInput copy;
+    private BeginTransactionInput diff;
+
+    @Test
+    public void buildBeginTransactionInputWithUserID() {
+        userID = new UserId(ID);
+        listParam = new BeginTransactionInputBuilder()
+                .userId(userID)
+                .build();
+        def = new BeginTransactionInputBuilder()
+                .userId(userID)
+                .addAugmentation(BeginTransactionInput.class, listParam)
+                .build();
+        def = new BeginTransactionInputBuilder(def)
+                .addAugmentation(BeginTransactionInput.class, null)
+                .build();
+        assertEquals(ID_ERROR_MSG, userID, def.getUserId());
+        assertEquals(AUGMENTATION_ERROR_MSG, listParam, def);
+    }
+
+    @Test
+    public void fromBeginTransactionInput() {
+        userID = new UserId(ID);
+        def = new BeginTransactionInputBuilder()
+                .userId(userID)
+                .build();
+        copy = new BeginTransactionInputBuilder(def).build();
+        assertEquals(ID_ERROR_MSG, userID, copy.getUserId());
+    }
+
+    @Test
+    public void equality() {
+        userID = new UserId(ID);
+        def = new BeginTransactionInputBuilder()
+                .userId(userID)
+                .build();
+        copy = new BeginTransactionInputBuilder()
+                .userId(userID)
+                .build();
+        otherID = new UserId(OTHER_ID);
+        diff = new BeginTransactionInputBuilder()
+                .userId(otherID)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(def, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/intent/BeginTransactionOutputBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/BeginTransactionOutputBuilderTest.java
new file mode 100644
index 0000000..fa9a0ec
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/BeginTransactionOutputBuilderTest.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.intent.CommonRpcResult.Code;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link BeginTransactionOutputBuilder}.
+ */
+public class BeginTransactionOutputBuilderTest {
+
+    private static final String MESSAGE = "SomeMessage";
+    private static final int OK = 1;
+    private static final int ERROR = 0;
+    private static final String MESSAGE_ERROR_MSG = "message not set";
+    private static final String CODE_ERROR_MSG = "result code not set";
+    private static final String AUGMENTATION_ERROR_MSG = "augmentation not equal";
+
+    private Code resultCode;
+    private Code otherResultCode;
+    private BeginTransactionOutput listParam;
+    private BeginTransactionOutput def;
+    private BeginTransactionOutput copy;
+    private BeginTransactionOutput diff;
+
+    @Test
+    public void buildBeginTransactionOutput() {
+        resultCode = Code.forValue(OK);
+        listParam = ((BeginTransactionOutputBuilder)
+                new BeginTransactionOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        def = ((BeginTransactionOutputBuilder) new BeginTransactionOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .addAugmentation(BeginTransactionOutput.class, listParam)
+                .build();
+        def = new BeginTransactionOutputBuilder(def)
+                .addAugmentation(BeginTransactionOutput.class, null)
+                .build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, def.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+        assertEquals(AUGMENTATION_ERROR_MSG, listParam, def);
+    }
+
+    @Test
+    public void fromBeginTransactionOutput() {
+        resultCode = Code.forValue(OK);
+        def = ((BeginTransactionOutputBuilder) new BeginTransactionOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        copy = new BeginTransactionOutputBuilder(def).build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, copy.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+    }
+
+    @Test
+    public void equality() {
+        resultCode = Code.forValue(OK);
+        def = ((BeginTransactionOutputBuilder) new BeginTransactionOutputBuilder()
+                .resultCode(resultCode))
+                .build();
+        copy = ((BeginTransactionOutputBuilder) new BeginTransactionOutputBuilder()
+                .resultCode(resultCode))
+                .build();
+        otherResultCode = Code.forValue(ERROR);
+        diff = ((BeginTransactionOutputBuilder) new BeginTransactionOutputBuilder()
+                .resultCode(otherResultCode))
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(def, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/intent/EndTransactionInputBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/EndTransactionInputBuilderTest.java
new file mode 100644
index 0000000..bd4b76c
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/EndTransactionInputBuilderTest.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.UserId;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link EndTransactionInputBuilder}.
+ */
+public class EndTransactionInputBuilderTest {
+
+    private static final String ID = "00000000-0000-0000-0000-000000000000";
+    private static final String OTHER_ID = "00000000-0000-0000-0000-000000000001";
+    private static final String ID_ERROR_MSG = "id not set";
+    private static final String AUGMENTATION_ERROR_MSG = "augmentation not equal";
+
+    private UserId userID;
+    private UserId otherID;
+    private EndTransactionInput listParam;
+    private EndTransactionInput def;
+    private EndTransactionInput copy;
+    private EndTransactionInput diff;
+
+    @Test
+    public void buildEndTransactionInputWithUserID() {
+        userID = new UserId(ID);
+        listParam = new EndTransactionInputBuilder()
+                .userId(userID)
+                .build();
+        def = new EndTransactionInputBuilder()
+                .userId(userID)
+                .addAugmentation(EndTransactionInput.class, listParam)
+                .build();
+        def = new EndTransactionInputBuilder(def)
+                .addAugmentation(EndTransactionInput.class, null)
+                .build();
+        assertEquals(ID_ERROR_MSG, userID, def.getUserId());
+        assertEquals(AUGMENTATION_ERROR_MSG, listParam, def);
+    }
+
+    @Test
+    public void fromEndTransactionInput() {
+        userID = new UserId(ID);
+        def = new EndTransactionInputBuilder()
+                .userId(userID)
+                .build();
+        copy = new EndTransactionInputBuilder(def).build();
+        assertEquals(ID_ERROR_MSG, userID, copy.getUserId());
+    }
+
+    @Test
+    public void equality() {
+        userID = new UserId(ID);
+        def = new EndTransactionInputBuilder()
+                .userId(userID)
+                .build();
+        copy = new EndTransactionInputBuilder()
+                .userId(userID)
+                .build();
+        otherID = new UserId(OTHER_ID);
+        diff = new EndTransactionInputBuilder()
+                .userId(otherID)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(def, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/intent/EndTransactionOutputBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/EndTransactionOutputBuilderTest.java
new file mode 100644
index 0000000..e12289f
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/EndTransactionOutputBuilderTest.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.intent.CommonRpcResult.Code;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link EndTransactionOutputBuilder}.
+ */
+public class EndTransactionOutputBuilderTest {
+
+    private static final String MESSAGE = "SomeMessage";
+    private static final int OK = 1;
+    private static final int ERROR = 0;
+    private static final String MESSAGE_ERROR_MSG = "message not set";
+    private static final String CODE_ERROR_MSG = "result code not set";
+    private static final String AUGMENTATION_ERROR_MSG = "augmentation not equal";
+
+    private Code resultCode;
+    private Code otherResultCode;
+    private EndTransactionOutput listParam;
+    private EndTransactionOutput def;
+    private EndTransactionOutput copy;
+    private EndTransactionOutput diff;
+
+    @Test
+    public void buildEndTransactionOutput() {
+        resultCode = Code.forValue(OK);
+        listParam = ((EndTransactionOutputBuilder)
+                new EndTransactionOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        def = ((EndTransactionOutputBuilder) new EndTransactionOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .addAugmentation(EndTransactionOutput.class, listParam)
+                .build();
+        def = new EndTransactionOutputBuilder(def)
+                .addAugmentation(EndTransactionOutput.class, null)
+                .build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, def.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+        assertEquals(AUGMENTATION_ERROR_MSG, listParam, def);
+    }
+
+    @Test
+    public void fromEndTransactionOutput() {
+        resultCode = Code.forValue(OK);
+        def = ((EndTransactionOutputBuilder) new EndTransactionOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        copy = new EndTransactionOutputBuilder(def).build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, copy.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+    }
+
+    @Test
+    public void equality() {
+        resultCode = Code.forValue(OK);
+        def = ((EndTransactionOutputBuilder) new EndTransactionOutputBuilder()
+                .resultCode(resultCode))
+                .build();
+        copy = ((EndTransactionOutputBuilder) new EndTransactionOutputBuilder()
+                .resultCode(resultCode))
+                .build();
+        otherResultCode = Code.forValue(ERROR);
+        diff = ((EndTransactionOutputBuilder) new EndTransactionOutputBuilder()
+                .resultCode(otherResultCode))
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(def, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestInputBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestInputBuilderTest.java
new file mode 100644
index 0000000..227acc8
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestInputBuilderTest.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.UserId;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link LanguageStyleNemoRequestInputBuilder}.
+ */
+public class LanguageStyleNemoRequestInputBuilderTest {
+
+    private static final String ID = "00000000-0000-0000-0000-000000000000";
+    private static final String OTHER_ID = "00000000-0000-0000-0000-000000000001";
+    private static final String STATEMENT = "SomeStatement";
+    private static final String OTHER_STATEMENT= "OtherStatement";
+    private static final String ID_ERROR_MSG = "id not set";
+    private static final String STATEMENT_ERROR_MSG = "statement not set";
+    private static final String AUGMENTATION_ERROR_MSG = "augmentation not equal";
+
+    private UserId userID;
+    private UserId otherID;
+    private LanguageStyleNemoRequestInput listParam;
+    private LanguageStyleNemoRequestInput def;
+    private LanguageStyleNemoRequestInput copy;
+    private LanguageStyleNemoRequestInput diff;
+
+    @Test
+    public void buildLanguageStyleNemoRequestInputWithUserID() {
+        userID = new UserId(ID);
+        listParam = new LanguageStyleNemoRequestInputBuilder()
+                .userId(userID)
+                .nemoStatement(STATEMENT)
+                .build();
+        def = new LanguageStyleNemoRequestInputBuilder()
+                .userId(userID)
+                .nemoStatement(STATEMENT)
+                .addAugmentation(LanguageStyleNemoRequestInput.class, listParam)
+                .build();
+        def = new LanguageStyleNemoRequestInputBuilder(def)
+                .addAugmentation(LanguageStyleNemoRequestInput.class, null)
+                .build();
+        assertEquals(ID_ERROR_MSG, userID, def.getUserId());
+        assertEquals(STATEMENT_ERROR_MSG, STATEMENT, def.getNemoStatement());
+        assertEquals(AUGMENTATION_ERROR_MSG, listParam, def);
+    }
+
+    @Test
+    public void fromLanguageStyleNemoRequestInput() {
+        userID = new UserId(ID);
+        def = new LanguageStyleNemoRequestInputBuilder()
+                .userId(userID)
+                .nemoStatement(STATEMENT)
+                .build();
+        copy = new LanguageStyleNemoRequestInputBuilder(def).build();
+        assertEquals(ID_ERROR_MSG, userID, copy.getUserId());
+        assertEquals(STATEMENT_ERROR_MSG, STATEMENT, copy.getNemoStatement());
+    }
+
+    @Test
+    public void equality() {
+        userID = new UserId(ID);
+        def = new LanguageStyleNemoRequestInputBuilder()
+                .userId(userID)
+                .nemoStatement(STATEMENT)
+                .build();
+        copy = new LanguageStyleNemoRequestInputBuilder(def)
+                .build();
+        otherID = new UserId(OTHER_ID);
+        diff = new LanguageStyleNemoRequestInputBuilder()
+                .userId(otherID)
+                .nemoStatement(OTHER_STATEMENT)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(def, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestOutputBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestOutputBuilderTest.java
new file mode 100644
index 0000000..2271458
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/LanguageStyleNemoRequestOutputBuilderTest.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.intent.CommonRpcResult.Code;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link LanguageStyleNemoRequestOutputBuilder}.
+ */
+public class LanguageStyleNemoRequestOutputBuilderTest {
+
+    private static final String MESSAGE = "SomeMessage";
+    private static final int OK = 1;
+    private static final int ERROR = 0;
+    private static final String MESSAGE_ERROR_MSG = "message not set";
+    private static final String CODE_ERROR_MSG = "result code not set";
+    private static final String AUGMENTATION_ERROR_MSG = "augmentation not equal";
+
+    private Code resultCode;
+    private Code otherResultCode;
+    private LanguageStyleNemoRequestOutput listParam;
+    private LanguageStyleNemoRequestOutput def;
+    private LanguageStyleNemoRequestOutput copy;
+    private LanguageStyleNemoRequestOutput diff;
+
+    @Test
+    public void buildLanguageStyleNemoRequestOutput() {
+        resultCode = Code.forValue(OK);
+        listParam = ((LanguageStyleNemoRequestOutputBuilder)
+                new LanguageStyleNemoRequestOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        def = ((LanguageStyleNemoRequestOutputBuilder)
+                new LanguageStyleNemoRequestOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .addAugmentation(LanguageStyleNemoRequestOutput.class, listParam)
+                .build();
+        def = new LanguageStyleNemoRequestOutputBuilder(def)
+                .addAugmentation(LanguageStyleNemoRequestOutput.class, null)
+                .build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, def.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+        assertEquals(AUGMENTATION_ERROR_MSG, listParam, def);
+    }
+
+    @Test
+    public void fromLanguageStyleNemoRequestOutput() {
+        resultCode = Code.forValue(OK);
+        def = ((LanguageStyleNemoRequestOutputBuilder)
+                new LanguageStyleNemoRequestOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        copy = new LanguageStyleNemoRequestOutputBuilder(def).build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, copy.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+    }
+
+    @Test
+    public void equality() {
+        resultCode = Code.forValue(OK);
+        def = ((LanguageStyleNemoRequestOutputBuilder)
+                new LanguageStyleNemoRequestOutputBuilder()
+                .resultCode(resultCode))
+                .build();
+        copy = ((LanguageStyleNemoRequestOutputBuilder)
+                new LanguageStyleNemoRequestOutputBuilder()
+                .resultCode(resultCode))
+                .build();
+        otherResultCode = Code.forValue(ERROR);
+        diff = ((LanguageStyleNemoRequestOutputBuilder)
+                new LanguageStyleNemoRequestOutputBuilder()
+                .resultCode(otherResultCode))
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(def, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/intent/RegisterUserOutputBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/RegisterUserOutputBuilderTest.java
new file mode 100644
index 0000000..4181ffb
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/RegisterUserOutputBuilderTest.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.intent.CommonRpcResult.Code;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link RegisterUserOutputBuilder}.
+ */
+public class RegisterUserOutputBuilderTest {
+
+    private static final String MESSAGE = "SomeMessage";
+    private static final int OK = 1;
+    private static final int ERROR = 0;
+    private static final String MESSAGE_ERROR_MSG = "message not set";
+    private static final String CODE_ERROR_MSG = "result code not set";
+    private static final String AUGMENTATION_ERROR_MSG = "augmentation not equal";
+
+    private Code resultCode;
+    private Code otherResultCode;
+    private RegisterUserOutput listParam;
+    private RegisterUserOutput def;
+    private RegisterUserOutput copy;
+    private RegisterUserOutput diff;
+
+    @Test
+    public void buildRegisterUserOutput() {
+        resultCode = Code.forValue(OK);
+        listParam = ((RegisterUserOutputBuilder)
+                new RegisterUserOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        def = ((RegisterUserOutputBuilder) new RegisterUserOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .addAugmentation(RegisterUserOutput.class, listParam)
+                .build();
+        def = new RegisterUserOutputBuilder(def)
+                .addAugmentation(RegisterUserOutput.class, null)
+                .build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, def.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+        assertEquals(AUGMENTATION_ERROR_MSG, listParam, def);
+    }
+
+    @Test
+    public void fromRegisterUserOutput() {
+        resultCode = Code.forValue(OK);
+        def = ((RegisterUserOutputBuilder) new RegisterUserOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        copy = new RegisterUserOutputBuilder(def).build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, copy.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+    }
+
+    @Test
+    public void equality() {
+        resultCode = Code.forValue(OK);
+        def = ((RegisterUserOutputBuilder) new RegisterUserOutputBuilder()
+                .resultCode(resultCode))
+                .build();
+        copy = ((RegisterUserOutputBuilder) new RegisterUserOutputBuilder()
+                .resultCode(resultCode))
+                .build();
+        otherResultCode = Code.forValue(ERROR);
+        diff = ((RegisterUserOutputBuilder) new RegisterUserOutputBuilder()
+                .resultCode(otherResultCode))
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(def, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/intent/StructureStyleNemoDeleteOutputBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/StructureStyleNemoDeleteOutputBuilderTest.java
new file mode 100644
index 0000000..9bf0636
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/StructureStyleNemoDeleteOutputBuilderTest.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.intent.CommonRpcResult.Code;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link StructureStyleNemoDeleteOutputBuilder}.
+ */
+public class StructureStyleNemoDeleteOutputBuilderTest {
+
+    private static final String MESSAGE = "SomeMessage";
+    private static final int OK = 1;
+    private static final int ERROR = 0;
+    private static final String MESSAGE_ERROR_MSG = "message not set";
+    private static final String CODE_ERROR_MSG = "result code not set";
+    private static final String AUGMENTATION_ERROR_MSG = "augmentation not equal";
+
+    private Code resultCode;
+    private Code otherResultCode;
+    private StructureStyleNemoDeleteOutput listParam;
+    private StructureStyleNemoDeleteOutput def;
+    private StructureStyleNemoDeleteOutput copy;
+    private StructureStyleNemoDeleteOutput diff;
+
+    @Test
+    public void buildStructureStyleNemoDeleteOutput() {
+        resultCode = Code.forValue(OK);
+        listParam = ((StructureStyleNemoDeleteOutputBuilder)
+                new StructureStyleNemoDeleteOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        def = ((StructureStyleNemoDeleteOutputBuilder)
+                new StructureStyleNemoDeleteOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .addAugmentation(StructureStyleNemoDeleteOutput.class, listParam)
+                .build();
+        def = new StructureStyleNemoDeleteOutputBuilder(def)
+                .addAugmentation(StructureStyleNemoDeleteOutput.class, null)
+                .build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, def.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+        assertEquals(AUGMENTATION_ERROR_MSG, listParam, def);
+    }
+
+    @Test
+    public void fromStructureStyleNemoDeleteOutput() {
+        resultCode = Code.forValue(OK);
+        def = ((StructureStyleNemoDeleteOutputBuilder)
+                new StructureStyleNemoDeleteOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        copy = new StructureStyleNemoDeleteOutputBuilder(def).build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, copy.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+    }
+
+    @Test
+    public void equality() {
+        resultCode = Code.forValue(OK);
+        def = ((StructureStyleNemoDeleteOutputBuilder)
+                new StructureStyleNemoDeleteOutputBuilder()
+                .resultCode(resultCode))
+                .build();
+        copy = ((StructureStyleNemoDeleteOutputBuilder)
+                new StructureStyleNemoDeleteOutputBuilder()
+                .resultCode(resultCode))
+                .build();
+        otherResultCode = Code.forValue(ERROR);
+        diff = ((StructureStyleNemoDeleteOutputBuilder)
+                new StructureStyleNemoDeleteOutputBuilder()
+                .resultCode(otherResultCode))
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(def, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/intent/StructureStyleNemoUpdateOutputBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/StructureStyleNemoUpdateOutputBuilderTest.java
new file mode 100644
index 0000000..4638c22
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/StructureStyleNemoUpdateOutputBuilderTest.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.intent.CommonRpcResult.Code;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link StructureStyleNemoUpdateOutputBuilder}.
+ */
+public class StructureStyleNemoUpdateOutputBuilderTest {
+
+    private static final String MESSAGE = "SomeMessage";
+    private static final int OK = 1;
+    private static final int ERROR = 0;
+    private static final String MESSAGE_ERROR_MSG = "message not set";
+    private static final String CODE_ERROR_MSG = "result code not set";
+    private static final String AUGMENTATION_ERROR_MSG = "augmentation not equal";
+
+    private Code resultCode;
+    private Code otherResultCode;
+    private StructureStyleNemoUpdateOutput listParam;
+    private StructureStyleNemoUpdateOutput def;
+    private StructureStyleNemoUpdateOutput copy;
+    private StructureStyleNemoUpdateOutput diff;
+
+    @Test
+    public void buildStructureStyleNemoUpdateOutput() {
+        resultCode = Code.forValue(OK);
+        listParam = ((StructureStyleNemoUpdateOutputBuilder)
+                new StructureStyleNemoUpdateOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        def = ((StructureStyleNemoUpdateOutputBuilder)
+                new StructureStyleNemoUpdateOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .addAugmentation(StructureStyleNemoUpdateOutput.class, listParam)
+                .build();
+        def = new StructureStyleNemoUpdateOutputBuilder(def)
+                .addAugmentation(StructureStyleNemoUpdateOutput.class, null)
+                .build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, def.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+        assertEquals(AUGMENTATION_ERROR_MSG, listParam, def);
+    }
+
+    @Test
+    public void fromStructureStyleNemoUpdateOutput() {
+        resultCode = Code.forValue(OK);
+        def = ((StructureStyleNemoUpdateOutputBuilder)
+                new StructureStyleNemoUpdateOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        copy = new StructureStyleNemoUpdateOutputBuilder(def).build();
+        assertEquals(MESSAGE_ERROR_MSG, MESSAGE, copy.getMessage());
+        assertEquals(CODE_ERROR_MSG, resultCode, def.getResultCode());
+    }
+
+    @Test
+    public void equality() {
+        resultCode = Code.forValue(OK);
+        def = ((StructureStyleNemoUpdateOutputBuilder)
+                new StructureStyleNemoUpdateOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        copy = ((StructureStyleNemoUpdateOutputBuilder)
+                new StructureStyleNemoUpdateOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(resultCode))
+                .build();
+        otherResultCode = Code.forValue(ERROR);
+        diff = ((StructureStyleNemoUpdateOutputBuilder)
+                new StructureStyleNemoUpdateOutputBuilder()
+                .message(MESSAGE)
+                .resultCode(otherResultCode))
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(def, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/ObjectsBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/ObjectsBuilderTest.java
new file mode 100644
index 0000000..7916fb1
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/ObjectsBuilderTest.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent.structure.style.nemo.delete.input;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.ConnectionId;
+import org.onosproject.nemo.model.common.FlowId;
+import org.onosproject.nemo.model.common.NodeId;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link ObjectsBuilder}.
+ */
+public class ObjectsBuilderTest {
+
+    private static final String OBJECTS_ERROR_MSG =
+            "objects not set";
+    private static final String ID = "00000000-0000-0000-0000-000000000000";
+    private static final String OTHER_ID = "00000000-0000-0000-0000-000000000001";
+
+    private List<ConnectionId> connectionIdList;
+    private List<ConnectionId> otherConnectionIdList;
+    private List<FlowId> flowIdList;
+    private List<FlowId> otherFlowIdList;
+    private List<NodeId> nodeIdList;
+    private List<NodeId> otherNodeIdList;
+    private Objects objects;
+    private Objects copy;
+    private Objects diff;
+    private ConnectionId connectionID;
+    private ConnectionId otherconnectionID;
+
+    @Test
+    public void buildObjectsWithOperationIDlist() {
+        connectionIdList = new ArrayList<>();
+        flowIdList = new ArrayList<>();
+        nodeIdList = new ArrayList<>();
+        objects = new ObjectsBuilder()
+                .connectionIds(connectionIdList)
+                .flowIds(flowIdList).nodeIds(nodeIdList)
+                .build();
+        assertEquals(OBJECTS_ERROR_MSG, connectionIdList,
+                objects.getConnectionIds());
+        assertEquals(OBJECTS_ERROR_MSG, flowIdList, objects.getFlowIds());
+        assertEquals(OBJECTS_ERROR_MSG, nodeIdList, objects.getNodeIds());
+    }
+
+    @Test
+    public void fromObjects() {
+        connectionIdList = new ArrayList<>();
+        flowIdList = new ArrayList<>();
+        nodeIdList = new ArrayList<>();
+        objects = new ObjectsBuilder()
+                .connectionIds(connectionIdList)
+                .flowIds(flowIdList).nodeIds(nodeIdList)
+                .build();
+        copy = new ObjectsBuilder(objects).build();
+        assertEquals(OBJECTS_ERROR_MSG, connectionIdList,
+                copy.getConnectionIds());
+    }
+
+    @Test
+    public void equality() {
+        connectionIdList = new ArrayList<>();
+        flowIdList = new ArrayList<>();
+        nodeIdList = new ArrayList<>();
+        objects = new ObjectsBuilder()
+                .connectionIds(connectionIdList)
+                .flowIds(flowIdList).nodeIds(nodeIdList)
+                .build();
+        otherConnectionIdList = new ArrayList<>();
+        otherConnectionIdList.add(null);
+        otherFlowIdList = new ArrayList<>();
+        otherFlowIdList.add(null);
+        otherNodeIdList = new ArrayList<>();
+        otherNodeIdList.add(null);
+        copy = new ObjectsBuilder().connectionIds(connectionIdList)
+                .flowIds(flowIdList).nodeIds(nodeIdList)
+                .build();
+        diff = new ObjectsBuilder().connectionIds(otherConnectionIdList)
+                .flowIds(otherFlowIdList).nodeIds(otherNodeIdList)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(objects, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+
+    @Test
+    public void equalityTwo() {
+        connectionID = new ConnectionId(ID);
+        otherconnectionID = new ConnectionId(OTHER_ID);
+        connectionIdList = new ArrayList<>();
+        connectionIdList.add(connectionID);
+        flowIdList = new ArrayList<>();
+        nodeIdList = new ArrayList<>();
+        objects = new ObjectsBuilder()
+                .connectionIds(connectionIdList)
+                .flowIds(flowIdList).nodeIds(nodeIdList)
+                .build();
+        otherConnectionIdList = new ArrayList<>();
+        otherConnectionIdList.add(otherconnectionID);
+        copy = new ObjectsBuilder()
+                .connectionIds(connectionIdList)
+                .flowIds(flowIdList).nodeIds(nodeIdList)
+                .build();
+        diff = new ObjectsBuilder()
+                .connectionIds(otherConnectionIdList)
+                .flowIds(flowIdList).nodeIds(nodeIdList)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(objects, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/OperationsBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/OperationsBuilderTest.java
new file mode 100644
index 0000000..ceed8c5
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/intent/structure/style/nemo/delete/input/OperationsBuilderTest.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.intent.structure.style.nemo.delete.input;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.OperationId;
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link OperationsBuilder}.
+ */
+public class OperationsBuilderTest {
+
+    private static final String OPERATIONS_ERROR_MSG =
+            "operations not set";
+    private static final String ID = "00000000-0000-0000-0000-000000000000";
+    private static final String OTHER_ID = "00000000-0000-0000-0000-000000000001";
+
+    private List<OperationId> operationIdList;
+    private List<OperationId> otherList;
+    private Operations operations;
+    private Operations copy;
+    private Operations diff;
+    private OperationId operationID;
+    private OperationId otheroperationID;
+
+    @Test
+    public void buildOperationsWithOperationIDlist() {
+        operationIdList = new ArrayList<>();
+        operations = new OperationsBuilder()
+                .operationIds(operationIdList)
+                .build();
+        assertEquals(OPERATIONS_ERROR_MSG, operationIdList,
+                operations.getOperationIds());
+    }
+
+    @Test
+    public void fromOperations() {
+        operationIdList = new ArrayList<>();
+        operations = new OperationsBuilder()
+                .operationIds(operationIdList)
+                .build();
+        copy = new OperationsBuilder(operations).build();
+        assertEquals(OPERATIONS_ERROR_MSG, operationIdList,
+                copy.getOperationIds());
+    }
+
+    @Test
+    public void equality() {
+        operationIdList = new ArrayList<>();
+        operations = new OperationsBuilder().operationIds(operationIdList).build();
+        otherList = new ArrayList<>();
+        otherList.add(null);
+        copy = new OperationsBuilder().operationIds(operationIdList).build();
+        diff = new OperationsBuilder().operationIds(otherList).build();
+        new EqualsTester()
+                .addEqualityGroup(operations, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+
+    @Test
+    public void equalityTwo() {
+        operationID = new OperationId(ID);
+        otheroperationID = new OperationId(OTHER_ID);
+        operationIdList = new ArrayList<>();
+        operationIdList.add(operationID);
+        operations = new OperationsBuilder().operationIds(operationIdList).build();
+        otherList = new ArrayList<>();
+        otherList.add(otheroperationID);
+        copy = new OperationsBuilder().operationIds(operationIdList).build();
+        diff = new OperationsBuilder().operationIds(otherList).build();
+        new EqualsTester()
+                .addEqualityGroup(operations, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/operation/ActionDefinitionsBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/ActionDefinitionsBuilderTest.java
new file mode 100644
index 0000000..10d4046
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/ActionDefinitionsBuilderTest.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.ActionName;
+import org.onosproject.nemo.model.operation.action.definitions.ActionDefinition;
+import org.onosproject.nemo.model.operation.action.definitions.ActionDefinitionBuilder;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link ActionDefinitionsBuilder}.
+ */
+public class ActionDefinitionsBuilderTest {
+
+    private static final String DEFINITIONS_ERROR_MSG = "definitions not set";
+    private static final String NAME = "SomeName";
+    private static final String OTHER_NAME = "OtherName";
+
+    private List<ActionDefinition> definitionList;
+    private List<ActionDefinition> otherList;
+    private ActionDefinitions definitions;
+    private ActionDefinitions copy;
+    private ActionDefinitions diff;
+    private ActionName name;
+    private ActionName otherName;
+    private ActionDefinition definition;
+    private ActionDefinition otherDefinition;
+
+    @Test
+    public void buildActionDefinitionWithActionDefinitions() {
+        definitionList = new ArrayList<>();
+        definitions = new ActionDefinitionsBuilder()
+                .actionDefinitions(definitionList)
+                .build();
+        assertEquals(DEFINITIONS_ERROR_MSG, definitionList,
+                definitions.getActionDefinitions());
+    }
+
+    @Test
+    public void fromActionDefinitionWithActionDefinitions() {
+        definitionList = new ArrayList<>();
+        definitions = new ActionDefinitionsBuilder()
+                .actionDefinitions(definitionList)
+                .build();
+        copy = new ActionDefinitionsBuilder(definitions).build();
+        assertEquals(DEFINITIONS_ERROR_MSG, definitionList,
+                copy.getActionDefinitions());
+    }
+
+    @Test
+    public void equality() {
+        definitionList = new ArrayList<>();
+        definitions = new ActionDefinitionsBuilder()
+                .actionDefinitions(definitionList)
+                .build();
+        otherList = new ArrayList<>();
+        otherList.add(null);
+        copy = new ActionDefinitionsBuilder()
+                .actionDefinitions(definitionList)
+                .build();
+        diff = new ActionDefinitionsBuilder()
+                .actionDefinitions(otherList)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(definitions, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+
+    @Test
+    public void equalityTwo() {
+        name = new ActionName(NAME);
+        otherName = new ActionName(OTHER_NAME);
+        definition = new ActionDefinitionBuilder()
+                .actionName(name)
+                .build();
+        definitionList = new ArrayList<>();
+        definitionList.add(definition);
+        definitions = new ActionDefinitionsBuilder()
+                .actionDefinitions(definitionList)
+                .build();
+        otherList = new ArrayList<>();
+        otherDefinition = new ActionDefinitionBuilder()
+                .actionName(otherName)
+                .build();
+        otherList.add(otherDefinition);
+        copy = new ActionDefinitionsBuilder()
+                .actionDefinitions(definitionList)
+                .build();
+        diff = new ActionDefinitionsBuilder()
+                .actionDefinitions(otherList)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(definitions, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/operation/ConditionParameterDefinitionsBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/ConditionParameterDefinitionsBuilderTest.java
new file mode 100644
index 0000000..f52c760
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/ConditionParameterDefinitionsBuilderTest.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.ParameterName;
+import org.onosproject.nemo.model.operation.condition.parameter.definitions.ConditionParameterDefinition;
+import org.onosproject.nemo.model.operation.condition.parameter.definitions.ConditionParameterDefinitionBuilder;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link ConditionParameterDefinitionsBuilder}.
+ */
+public class ConditionParameterDefinitionsBuilderTest {
+
+    private static final String DEFINITIONS_ERROR_MSG = "definitions not set";
+    private static final String NAME = "SomeName";
+    private static final String OTHER_NAME = "OtherName";
+
+    private List<ConditionParameterDefinition> definitionList;
+    private List<ConditionParameterDefinition> otherList;
+    private ConditionParameterDefinitions definitions;
+    private ConditionParameterDefinitions copy;
+    private ConditionParameterDefinitions diff;
+    private ParameterName name;
+    private ParameterName otherName;
+    private ConditionParameterDefinition definition;
+    private ConditionParameterDefinition otherdefinition;
+
+    @Test
+    public void buildConditionParameterDefinitionWithParameterDefinitions() {
+        definitionList = new ArrayList<>();
+        definitions = new ConditionParameterDefinitionsBuilder()
+                .conditionParameterDefinitions(definitionList)
+                .build();
+        assertEquals(DEFINITIONS_ERROR_MSG, definitionList,
+                definitions.getDefinitions());
+    }
+
+    @Test
+    public void fromConditionParameterDefinitionWithParameterDefinitions() {
+        definitionList = new ArrayList<>();
+        definitions = new ConditionParameterDefinitionsBuilder()
+                .conditionParameterDefinitions(definitionList)
+                .build();
+        copy = new ConditionParameterDefinitionsBuilder(definitions).build();
+        assertEquals(DEFINITIONS_ERROR_MSG, definitionList,
+                copy.getDefinitions());
+    }
+
+    @Test
+    public void equality() {
+        definitionList = new ArrayList<>();
+        definitions = new ConditionParameterDefinitionsBuilder()
+                .conditionParameterDefinitions(definitionList)
+                .build();
+        otherList = new ArrayList<>();
+        otherList.add(null);
+        copy = new ConditionParameterDefinitionsBuilder()
+                .conditionParameterDefinitions(definitionList)
+                .build();
+        diff = new ConditionParameterDefinitionsBuilder()
+                .conditionParameterDefinitions(otherList)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(definitions, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+
+    @Test
+    public void equalityTwo() {
+        name = new ParameterName(NAME);
+        otherName = new ParameterName(OTHER_NAME);
+        definition = new ConditionParameterDefinitionBuilder()
+                .parameterName(name)
+                .build();
+        definitionList = new ArrayList<>();
+        definitionList.add(definition);
+        definitions = new ConditionParameterDefinitionsBuilder()
+                .conditionParameterDefinitions(definitionList)
+                .build();
+        otherList = new ArrayList<>();
+        otherdefinition = new ConditionParameterDefinitionBuilder()
+                .parameterName(otherName)
+                .build();
+        otherList.add(otherdefinition);
+        copy = new ConditionParameterDefinitionsBuilder()
+                .conditionParameterDefinitions(definitionList)
+                .build();
+        diff = new ConditionParameterDefinitionsBuilder()
+                .conditionParameterDefinitions(otherList)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(definitions, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionBuilderTest.java
new file mode 100644
index 0000000..8f8fc67
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionBuilderTest.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation.action.definitions;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.ActionName;
+import org.onosproject.nemo.model.operation.action.definitions.ActionDefinition
+        .ParameterValueType;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link ActionDefinitionBuilder}.
+ */
+public class ActionDefinitionBuilderTest {
+
+    private static final String NAME = "SomeName";
+    private static final String OTHER_NAME = "OtherName";
+    private static final String NAME_ERROR_MSG = "name not set";
+    private static final String KEY_ERROR_MSG = "key not set";
+    private static final String TYPE_ERROR_MSG = "type not set";
+    private static final int PARAMETER_VALUE_TYPE_VALID = 0;
+    private static final int PARAMETER_VALUE_TYPE_NOT_VALID = 100;
+
+    private ActionDefinitionKey key;
+    private ActionDefinition.ParameterValueType type;
+    private ActionName name;
+    private ActionName otherName;
+    private ActionDefinition listParam;
+    private ActionDefinition def;
+    private ActionDefinition copy;
+    private ActionDefinition diff;
+
+    @Test
+    public void buildActionDefinitionWithActionDefinitionKey() {
+        name = new ActionName(NAME);
+        key = new ActionDefinitionKey(name);
+        type = ParameterValueType.forValue(PARAMETER_VALUE_TYPE_VALID);
+        listParam = new ActionDefinitionBuilder()
+                .key(key)
+                .build();
+        def = new ActionDefinitionBuilder()
+                .key(key)
+                .parameterValueType(type)
+                .addAugmentation(ActionDefinition.class, listParam)
+                .build();
+        def = new ActionDefinitionBuilder(def)
+                .addAugmentation(ActionDefinition.class, null)
+                .build();
+        assertEquals(NAME_ERROR_MSG, name, def.getActionName());
+        assertEquals(KEY_ERROR_MSG, key, def.getKey());
+        assertEquals(TYPE_ERROR_MSG, type, def.getParameterValueType());
+    }
+
+    @Test
+    public void buildActionDefinitionWithActionName() {
+        name = new ActionName(NAME);
+        key = new ActionDefinitionKey(name);
+        type = ParameterValueType.forValue(PARAMETER_VALUE_TYPE_VALID);
+        listParam = new ActionDefinitionBuilder()
+                .actionName(name)
+                .build();
+        def = new ActionDefinitionBuilder()
+                .parameterValueType(type)
+                .actionName(name)
+                .addAugmentation(ActionDefinition.class, listParam)
+                .build();
+        def = new ActionDefinitionBuilder(def)
+                .addAugmentation(ActionDefinition.class, null)
+                .build();
+        assertEquals(NAME_ERROR_MSG, name, def.getActionName());
+        assertEquals(KEY_ERROR_MSG, key, def.getKey());
+        assertEquals(TYPE_ERROR_MSG, type, def.getParameterValueType());
+    }
+
+    @Test
+    public void fromActionWithActionKey() {
+        name = new ActionName(NAME);
+        key = new ActionDefinitionKey(name);
+        type = ParameterValueType.forValue(PARAMETER_VALUE_TYPE_VALID);
+        def = new ActionDefinitionBuilder()
+                .parameterValueType(type)
+                .key(key)
+                .build();
+        copy = new ActionDefinitionBuilder(def).build();
+        assertEquals(NAME_ERROR_MSG, name, copy.getActionName());
+        assertEquals(KEY_ERROR_MSG, key, copy.getKey());
+        assertEquals(TYPE_ERROR_MSG, type, def.getParameterValueType());
+    }
+
+    @Test
+    public void fromActionWithActionName() {
+        name = new ActionName(NAME);
+        key = new ActionDefinitionKey(name);
+        type = ParameterValueType.forValue(PARAMETER_VALUE_TYPE_VALID);
+        def = new ActionDefinitionBuilder()
+                .parameterValueType(type)
+                .actionName(name)
+                .build();
+        copy = new ActionDefinitionBuilder(def).build();
+        assertEquals(NAME_ERROR_MSG, name, copy.getActionName());
+        assertEquals(KEY_ERROR_MSG, key, copy.getKey());
+        assertEquals(TYPE_ERROR_MSG, type, def.getParameterValueType());
+    }
+
+    @Test
+    public void equality() {
+        name = new ActionName(NAME);
+        def = new ActionDefinitionBuilder()
+                .actionName(name)
+                .build();
+        copy = new ActionDefinitionBuilder()
+                .actionName(name)
+                .build();
+        otherName = new ActionName(OTHER_NAME);
+        diff = new ActionDefinitionBuilder()
+                .actionName(otherName)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(def, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void parameterValueTypeNotValid() {
+        ParameterValueType.forValue(PARAMETER_VALUE_TYPE_NOT_VALID);
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionKeyTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionKeyTest.java
new file mode 100644
index 0000000..c1110dd
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/action/definitions/ActionDefinitionKeyTest.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation.action.definitions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.ActionName;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link ActionDefinitionKey}.
+ */
+public class ActionDefinitionKeyTest {
+
+    private static final String NAME = "SomeName";
+    private static final String OTHER = "OtherName";
+    private static final String NAME_ERROR_MSG = "name not set";
+
+    private ActionDefinitionKey key;
+    private ActionDefinitionKey copy;
+    private ActionDefinitionKey diff;
+
+    @Test
+    public void fromActionName() {
+        key = new ActionDefinitionKey(new ActionName(NAME));
+        assertEquals(NAME_ERROR_MSG, NAME, key.getActionName().getValue());
+    }
+
+    @Test
+    public void copyConstructor() {
+        key = new ActionDefinitionKey(new ActionName(NAME));
+        copy = new ActionDefinitionKey(key);
+        new EqualsTester()
+                .addEqualityGroup(key, copy)
+                .testEquals();
+    }
+
+    @Test
+    public void equality() {
+        key = new ActionDefinitionKey(new ActionName(NAME));
+        copy = new ActionDefinitionKey(new ActionName(NAME));
+        diff = new ActionDefinitionKey(new ActionName(OTHER));
+        new EqualsTester()
+                .addEqualityGroup(key, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionBuilderTest.java
new file mode 100644
index 0000000..42995e1
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionBuilderTest.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation.condition.parameter.definitions;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.ParameterName;
+import org.onosproject.nemo.model.operation.condition.parameter.definitions.ConditionParameterDefinition.ParameterValueType;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link ConditionParameterDefinitionBuilder}.
+ */
+public class ConditionParameterDefinitionBuilderTest {
+
+    private static final String NAME = "SomeName";
+    private static final String OTHER_NAME = "OtherName";
+    private static final String NAME_ERROR_MSG = "name not set";
+    private static final String KEY_ERROR_MSG = "key not set";
+    private static final String TYPE_ERROR_MSG = "type not set";
+    private static final int PARAMETER_VALUE_TYPE_VALID = 0;
+    private static final int PARAMETER_VALUE_TYPE_NOT_VALID = 100;
+
+    private ConditionParameterDefinitionKey key;
+    private ConditionParameterDefinition.ParameterValueType type;
+    private ParameterName name;
+    private ParameterName otherName;
+    private ConditionParameterDefinition listParam;
+    private ConditionParameterDefinition def;
+    private ConditionParameterDefinition copy;
+    private ConditionParameterDefinition diff;
+
+    @Test
+    public void buildConditionParameterDefinitionWithParameterDefinitionKey() {
+        name = new ParameterName(NAME);
+        key = new ConditionParameterDefinitionKey(name);
+        type = ParameterValueType.forValue(PARAMETER_VALUE_TYPE_VALID);
+        listParam = new ConditionParameterDefinitionBuilder()
+                .key(key)
+                .parameterValueType(type)
+                .build();
+        def = new ConditionParameterDefinitionBuilder()
+                .key(key)
+                .parameterValueType(type)
+                .addAugmentation(ConditionParameterDefinition.class, listParam)
+                .build();
+        def = new ConditionParameterDefinitionBuilder(def)
+                .addAugmentation(ConditionParameterDefinition.class, null)
+                .build();
+        assertEquals(NAME_ERROR_MSG, name, def.getParameterName());
+        assertEquals(KEY_ERROR_MSG, key, def.getKey());
+        assertEquals(TYPE_ERROR_MSG, type, def.getParameterValueType());
+    }
+
+    @Test
+    public void buildConditionParameterDefinitionWithParameterName() {
+        name = new ParameterName(NAME);
+        key = new ConditionParameterDefinitionKey(name);
+        type = ParameterValueType.forValue(PARAMETER_VALUE_TYPE_VALID);
+        listParam = new ConditionParameterDefinitionBuilder()
+                .key(key)
+                .build();
+        def = new ConditionParameterDefinitionBuilder()
+                .parameterName(name)
+                .parameterValueType(type)
+                .addAugmentation(ConditionParameterDefinition.class, listParam)
+                .build();
+        def = new ConditionParameterDefinitionBuilder(def)
+                .addAugmentation(ConditionParameterDefinition.class, null)
+                .build();
+        assertEquals(NAME_ERROR_MSG, name, def.getParameterName());
+        assertEquals(KEY_ERROR_MSG, key, def.getKey());
+        assertEquals(TYPE_ERROR_MSG, type, def.getParameterValueType());
+    }
+
+    @Test
+    public void fromConditionParameterDefinitionWithParameterDefinitionKey() {
+        name = new ParameterName(NAME);
+        key = new ConditionParameterDefinitionKey(name);
+        type = ParameterValueType.forValue(PARAMETER_VALUE_TYPE_VALID);
+        def = new ConditionParameterDefinitionBuilder()
+                .key(key)
+                .parameterValueType(type)
+                .build();
+        copy = new ConditionParameterDefinitionBuilder(def).build();
+        assertEquals(NAME_ERROR_MSG, name, copy.getParameterName());
+        assertEquals(KEY_ERROR_MSG, key, copy.getKey());
+        assertEquals(TYPE_ERROR_MSG, type, def.getParameterValueType());
+    }
+
+    @Test
+    public void fromConditionParameterWithParameterName() {
+        name = new ParameterName(NAME);
+        key = new ConditionParameterDefinitionKey(name);
+        type = ParameterValueType.forValue(PARAMETER_VALUE_TYPE_VALID);
+        def = new ConditionParameterDefinitionBuilder()
+                .parameterName(name)
+                .parameterValueType(type)
+                .build();
+        copy = new ConditionParameterDefinitionBuilder(def).build();
+        assertEquals(NAME_ERROR_MSG, name, copy.getParameterName());
+        assertEquals(KEY_ERROR_MSG, key, copy.getKey());
+        assertEquals(TYPE_ERROR_MSG, type, def.getParameterValueType());
+    }
+
+    @Test
+    public void equality() {
+        name = new ParameterName(NAME);
+        def = new ConditionParameterDefinitionBuilder()
+                .parameterName(name)
+                .build();
+        copy = new ConditionParameterDefinitionBuilder()
+                .parameterName(name)
+                .build();
+        otherName = new ParameterName(OTHER_NAME);
+        diff = new ConditionParameterDefinitionBuilder()
+                .parameterName(otherName)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(def, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void parameterValueTypeNotValid() {
+        ParameterValueType.forValue(PARAMETER_VALUE_TYPE_NOT_VALID);
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionKeyTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionKeyTest.java
new file mode 100644
index 0000000..ea6a9ad
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/operation/condition/parameter/definitions/ConditionParameterDefinitionKeyTest.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.operation.condition.parameter.definitions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.ParameterName;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link ConditionParameterDefinitionKey}.
+ */
+public class ConditionParameterDefinitionKeyTest {
+
+    private static final String NAME = "SomeName";
+    private static final String OTHER = "OtherName";
+    private static final String NAME_ERROR_MSG = "name not set";
+
+    private ConditionParameterDefinitionKey key;
+    private ConditionParameterDefinitionKey copy;
+    private ConditionParameterDefinitionKey diff;
+
+    @Test
+    public void fromParameterName() {
+        key = new ConditionParameterDefinitionKey(new ParameterName(NAME));
+        assertEquals(NAME_ERROR_MSG, NAME, key.getParameterName().getValue());
+    }
+
+    @Test
+    public void copyConstructor() {
+        key = new ConditionParameterDefinitionKey(new ParameterName(NAME));
+        copy = new ConditionParameterDefinitionKey(key);
+        new EqualsTester()
+                .addEqualityGroup(key, copy)
+                .testEquals();
+    }
+
+    @Test
+    public void equality() {
+        key = new ConditionParameterDefinitionKey(new ParameterName(NAME));
+        copy = new ConditionParameterDefinitionKey(new ParameterName(NAME));
+        diff = new ConditionParameterDefinitionKey(new ParameterName(OTHER));
+        new EqualsTester()
+                .addEqualityGroup(key, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/user/UserRolesBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/user/UserRolesBuilderTest.java
new file mode 100644
index 0000000..e3f01df
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/user/UserRolesBuilderTest.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.user;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.UserRoleDescription;
+import org.onosproject.nemo.model.common.UserRoleName;
+import org.onosproject.nemo.model.user.roles.UserRole;
+import org.onosproject.nemo.model.user.roles.UserRoleBuilder;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit tests for {@link UserRolesBuilder}.
+ */
+public class UserRolesBuilderTest {
+
+    private static final String ROLES_ERROR_MSG = "user roles not set";
+    private static final String NAME = "SomeName";
+    private static final String OTHER_NAME = "OtherName";
+    private static final String DESC = "SomeDescription";
+
+    private List<UserRole> roleList;
+    private List<UserRole> otherList;
+    private UserRoles roles;
+    private UserRoles copy;
+    private UserRoles diff;
+    private UserRoleDescription desc;
+    private UserRoleName name;
+    private UserRoleName otherName;
+    private UserRole role;
+    private UserRole otherRole;
+
+    @Test
+    public void buildUserRoleWithUserRoles() {
+        roleList = new ArrayList<>();
+        roles = new UserRolesBuilder()
+                .userRoles(roleList)
+                .build();
+        assertEquals(ROLES_ERROR_MSG, roleList, roles.getUserRoles());
+    }
+
+    @Test
+    public void fromUserRoleWithUserRoles() {
+        roleList = new ArrayList<>();
+        roles = new UserRolesBuilder()
+                .userRoles(roleList)
+                .build();
+        copy = new UserRolesBuilder(roles).build();
+        assertEquals(ROLES_ERROR_MSG, roleList, copy.getUserRoles());
+    }
+
+    @Test
+    public void equality() {
+        roleList = new ArrayList<>();
+        roles = new UserRolesBuilder()
+                .userRoles(roleList)
+                .build();
+        otherList = new ArrayList<>();
+        otherList.add(null);
+        copy = new UserRolesBuilder()
+                .userRoles(roleList)
+                .build();
+        diff = new UserRolesBuilder()
+                .userRoles(otherList)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(roles, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+
+    @Test
+    public void equalityTwo() {
+        name = new UserRoleName(NAME);
+        otherName = new UserRoleName(OTHER_NAME);
+        desc = new UserRoleDescription(DESC);
+        role = new UserRoleBuilder()
+                .roleDescription(desc)
+                .roleName(name)
+                .build();
+        roleList = new ArrayList<>();
+        roleList.add(role);
+        roles = new UserRolesBuilder()
+                .userRoles(roleList)
+                .build();
+        otherList = new ArrayList<>();
+        otherRole = new UserRoleBuilder()
+                .roleDescription(desc)
+                .roleName(otherName)
+                .build();
+        otherList.add(otherRole);
+        copy = new UserRolesBuilder()
+                .userRoles(roleList)
+                .build();
+        diff = new UserRolesBuilder()
+                .userRoles(otherList)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(roles, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/user/roles/UserRoleBuilderTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/user/roles/UserRoleBuilderTest.java
new file mode 100644
index 0000000..0ed2cd0
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/user/roles/UserRoleBuilderTest.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.user.roles;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.nemo.model.common.UserRoleDescription;
+import org.onosproject.nemo.model.common.UserRoleName;
+
+import com.google.common.testing.EqualsTester;
+/**
+ * Unit tests for {@link UserRoleBuilder}.
+ */
+public class UserRoleBuilderTest {
+
+    private static final String NAME = "SomeName";
+    private static final String OTHER_NAME = "OtherName";
+    private static final String DESC = "SomeDescription";
+    private static final String NAME_ERROR_MSG = "name not set";
+    private static final String DESC_ERROR_MSG = "description not set";
+    private static final String KEY_ERROR_MSG = "key not set";
+
+    private UserRoleKey key;
+    private UserRoleDescription desc;
+    private UserRoleName name;
+    private UserRoleName otherName;
+    private UserRole role;
+    private UserRole copy;
+    private UserRole diff;
+
+    @Test
+    public void buildUserRoleWithUserRoleKey() {
+        name = new UserRoleName(NAME);
+        key = new UserRoleKey(name);
+        desc = new UserRoleDescription(DESC);
+        role = new UserRoleBuilder()
+                .roleDescription(desc)
+                .key(key)
+                .build();
+        assertEquals(NAME_ERROR_MSG, name, role.getRoleName());
+        assertEquals(KEY_ERROR_MSG, key, role.getKey());
+        assertEquals(DESC_ERROR_MSG, desc, role.getRoleDescription());
+    }
+
+    @Test
+    public void buildUserRoleWithRoleName() {
+        name = new UserRoleName(NAME);
+        key = new UserRoleKey(name);
+        desc = new UserRoleDescription(DESC);
+        role = new UserRoleBuilder()
+                .roleDescription(desc)
+                .roleName(name)
+                .build();
+        assertEquals(NAME_ERROR_MSG, name, role.getRoleName());
+        assertEquals(KEY_ERROR_MSG, key, role.getKey());
+        assertEquals(DESC_ERROR_MSG, desc, role.getRoleDescription());
+    }
+
+    @Test
+    public void fromUserRoleWithRoleKey() {
+        name = new UserRoleName(NAME);
+        key = new UserRoleKey(name);
+        desc = new UserRoleDescription(DESC);
+        role = new UserRoleBuilder()
+                .roleDescription(desc)
+                .key(key)
+                .build();
+        copy = new UserRoleBuilder(role).build();
+        assertEquals(NAME_ERROR_MSG, name, copy.getRoleName());
+        assertEquals(KEY_ERROR_MSG, key, copy.getKey());
+        assertEquals(DESC_ERROR_MSG, desc, copy.getRoleDescription());
+    }
+
+    @Test
+    public void fromUserRoleWithRoleName() {
+        name = new UserRoleName(NAME);
+        key = new UserRoleKey(name);
+        desc = new UserRoleDescription(DESC);
+        role = new UserRoleBuilder()
+                .roleDescription(desc)
+                .roleName(name)
+                .build();
+        copy = new UserRoleBuilder(role).build();
+        assertEquals(NAME_ERROR_MSG, name, copy.getRoleName());
+        assertEquals(KEY_ERROR_MSG, key, copy.getKey());
+        assertEquals(DESC_ERROR_MSG, desc, copy.getRoleDescription());
+    }
+
+    @Test
+    public void equality() {
+        name = new UserRoleName(NAME);
+        desc = new UserRoleDescription(DESC);
+        role = new UserRoleBuilder()
+                .roleDescription(desc)
+                .roleName(name)
+                .build();
+        copy = new UserRoleBuilder()
+                .roleDescription(desc)
+                .roleName(name)
+                .build();
+        otherName = new UserRoleName(OTHER_NAME);
+        diff = new UserRoleBuilder()
+                .roleDescription(desc)
+                .roleName(otherName)
+                .build();
+        new EqualsTester()
+                .addEqualityGroup(role, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/user/roles/UserRoleKeyTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/user/roles/UserRoleKeyTest.java
new file mode 100644
index 0000000..d5686be
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/user/roles/UserRoleKeyTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.user.roles;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+import org.onosproject.nemo.model.common.UserRoleName;
+import org.onosproject.nemo.model.user.roles.UserRoleKey;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link UserRoleKey}.
+ */
+public class UserRoleKeyTest {
+
+    private static final String NAME = "SomeName";
+    private static final String OTHER = "OtherName";
+
+    private UserRoleKey key;
+    private UserRoleKey copy;
+    private UserRoleKey diff;
+
+    @Test
+    public void fromUserRoleName() {
+        key = new UserRoleKey(new UserRoleName(NAME));
+        assertEquals("name not set", NAME, key.getRoleName().getValue());
+    }
+
+    @Test
+    public void copyConstructor() {
+        key = new UserRoleKey(new UserRoleName(NAME));
+        copy = new UserRoleKey(key);
+        new EqualsTester()
+                .addEqualityGroup(key, copy)
+                .testEquals();
+    }
+
+    @Test
+    public void equality() {
+        key = new UserRoleKey(new UserRoleName(NAME));
+        copy = new UserRoleKey(new UserRoleName(NAME));
+        diff = new UserRoleKey(new UserRoleName(OTHER));
+        new EqualsTester()
+                .addEqualityGroup(key, copy)
+                .addEqualityGroup(diff)
+                .testEquals();
+    }
+}
\ No newline at end of file
