diff --git a/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java b/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
index 9d0a228..94e3b1a 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
@@ -77,34 +77,6 @@
     }
 
     /**
-     * Creates a connectivity intent that matches on the specified selector
-     * and applies the specified treatment.
-     * <p>
-     * Path will be optimized based on the first constraint if one is given.
-     * </p>
-     *
-     * @param appId       application identifier
-     * @param resources   required network resources (optional)
-     * @param selector    traffic selector
-     * @param treatment   treatment
-     * @param constraints optional prioritized list of constraints
-     * @param priority    priority to use for flows generated by this intent
-     * @throws NullPointerException if the selector or treatment is null
-     */
-
-    protected ConnectivityIntent(ApplicationId appId,
-                                 Collection<NetworkResource> resources,
-                                 TrafficSelector selector,
-                                 TrafficTreatment treatment,
-                                 List<Constraint> constraints,
-                                 int priority) {
-        super(appId, null, resources, priority);
-        this.selector = checkNotNull(selector);
-        this.treatment = checkNotNull(treatment);
-        this.constraints = checkNotNull(constraints);
-    }
-
-    /**
      * Constructor for serializer.
      */
     protected ConnectivityIntent() {
diff --git a/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java b/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java
index 9b00512..157397a 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java
@@ -15,20 +15,16 @@
  */
 package org.onosproject.net.intent;
 
-import com.google.common.base.MoreObjects;
-import com.google.common.collect.ImmutableList;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.net.HostId;
-import org.onosproject.net.Link;
-import org.onosproject.net.flow.DefaultTrafficSelector;
-import org.onosproject.net.flow.DefaultTrafficTreatment;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
-import org.onosproject.net.intent.constraint.LinkTypeConstraint;
-
 import java.util.Collections;
 import java.util.List;
 
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.HostId;
+import org.onosproject.net.flow.TrafficSelector;
+import org.onosproject.net.flow.TrafficTreatment;
+
+import com.google.common.base.MoreObjects;
+
 import static com.google.common.base.Preconditions.checkNotNull;
 
 /**
@@ -40,59 +36,98 @@
     private final HostId two;
 
     /**
-     * Creates a new host-to-host intent with the supplied host pair and no
-     * other traffic selection or treatment criteria.
+     * Returns a new host to host intent builder.
      *
-     * @param appId     application identifier
-     * @param one       first host
-     * @param two       second host
-     * @throws NullPointerException if {@code one} or {@code two} is null.
+     * @return host to host intent builder
      */
-    public HostToHostIntent(ApplicationId appId, HostId one, HostId two) {
-        this(appId, one, two,
-             DefaultTrafficSelector.emptySelector(),
-             DefaultTrafficTreatment.emptyTreatment(),
-             ImmutableList.of(new LinkTypeConstraint(false, Link.Type.OPTICAL)),
-             DEFAULT_INTENT_PRIORITY);
+    public static Builder builder() {
+        return new Builder();
     }
 
     /**
-     * Creates a new host-to-host intent with the supplied host pair.
-     *
-     * @param appId     application identifier
-     * @param one       first host
-     * @param two       second host
-     * @param selector  action
-     * @param treatment ingress port
-     * @throws NullPointerException if {@code one} or {@code two} is null.
+     * Builder of a host to host intent.
      */
-    public HostToHostIntent(ApplicationId appId, HostId one, HostId two,
-                            TrafficSelector selector,
-                            TrafficTreatment treatment) {
-        this(appId, one, two, selector, treatment,
-             ImmutableList.of(new LinkTypeConstraint(false, Link.Type.OPTICAL)),
-             DEFAULT_INTENT_PRIORITY);
+    public static final class Builder extends ConnectivityIntent.Builder {
+        HostId one;
+        HostId two;
+
+        private Builder() {
+            // Hide constructor
+        }
+
+        @Override
+        public Builder appId(ApplicationId appId) {
+            return (Builder) super.appId(appId);
+        }
+
+        @Override
+        public Builder key(Key key) {
+            return (Builder) super.key(key);
+        }
+
+        @Override
+        public Builder selector(TrafficSelector selector) {
+            return (Builder) super.selector(selector);
+        }
+
+        @Override
+        public Builder treatment(TrafficTreatment treatment) {
+            return (Builder) super.treatment(treatment);
+        }
+
+        @Override
+        public Builder constraints(List<Constraint> constraints) {
+            return (Builder) super.constraints(constraints);
+        }
+
+        @Override
+        public Builder priority(int priority) {
+            return (Builder) super.priority(priority);
+        }
+
+        /**
+         * Sets the first host of the intent that will be built.
+         *
+         * @param one first host
+         * @return this builder
+         */
+        public Builder one(HostId one) {
+            this.one = one;
+            return this;
+        }
+
+        /**
+         * Sets the second host of the intent that will be built.
+         *
+         * @param two second host
+         * @return this builder
+         */
+        public Builder two(HostId two) {
+            this.two = two;
+            return this;
+        }
+
+        /**
+         * Builds a host to host intent from the accumulated parameters.
+         *
+         * @return point to point intent
+         */
+        public HostToHostIntent build() {
+
+            return new HostToHostIntent(
+                    appId,
+                    key,
+                    one,
+                    two,
+                    selector,
+                    treatment,
+                    constraints,
+                    priority
+            );
+        }
     }
 
-    /**
-     * Creates a new host-to-host intent with the supplied host pair.
-     *
-     * @param appId       application identifier
-     * @param one         first host
-     * @param two         second host
-     * @param selector    action
-     * @param treatment   ingress port
-     * @param constraints optional prioritized list of path selection constraints
-     * @param priority    priority to use for flows generated by this intent
-     * @throws NullPointerException if {@code one} or {@code two} is null.
-     */
-    public HostToHostIntent(ApplicationId appId, HostId one, HostId two,
-                            TrafficSelector selector,
-                            TrafficTreatment treatment,
-                            List<Constraint> constraints,
-                            int priority) {
-        this(appId, null, one, two, selector, treatment, constraints, priority);
-    }
+
     /**
      * Creates a new host-to-host intent with the supplied host pair.
      *
@@ -106,7 +141,7 @@
      * @param priority    priority to use for flows generated by this intent
      * @throws NullPointerException if {@code one} or {@code two} is null.
      */
-    public HostToHostIntent(ApplicationId appId, Key key,
+    private HostToHostIntent(ApplicationId appId, Key key,
                             HostId one, HostId two,
                             TrafficSelector selector,
                             TrafficTreatment treatment,
@@ -121,14 +156,6 @@
 
     }
 
-    private static HostId min(HostId one, HostId two) {
-        return one.hashCode() < two.hashCode() ? one : two;
-    }
-
-    private static HostId max(HostId one, HostId two) {
-        return one.hashCode() >= two.hashCode() ? one : two;
-    }
-
     /**
      * Returns identifier of the first host.
      *
diff --git a/core/api/src/main/java/org/onosproject/net/intent/Intent.java b/core/api/src/main/java/org/onosproject/net/intent/Intent.java
index 725fac4..59378f7 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/Intent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/Intent.java
@@ -63,17 +63,6 @@
      * Creates a new intent.
      *
      * @param appId     application identifier
-     * @param resources required network resources (optional)
-     */
-    protected Intent(ApplicationId appId,
-                     Collection<NetworkResource> resources) {
-        this(appId, null, resources, DEFAULT_INTENT_PRIORITY);
-    }
-
-    /**
-     * Creates a new intent.
-     *
-     * @param appId     application identifier
      * @param key       optional key
      * @param resources required network resources (optional)
      * @param priority  flow rule priority
diff --git a/core/api/src/main/java/org/onosproject/net/intent/LinkCollectionIntent.java b/core/api/src/main/java/org/onosproject/net/intent/LinkCollectionIntent.java
index 17451cb..8cea253 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/LinkCollectionIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/LinkCollectionIntent.java
@@ -15,8 +15,8 @@
  */
 package org.onosproject.net.intent;
 
-import com.google.common.base.MoreObjects;
-import com.google.common.collect.ImmutableSet;
+import java.util.List;
+import java.util.Set;
 
 import org.onosproject.core.ApplicationId;
 import org.onosproject.net.ConnectPoint;
@@ -24,9 +24,8 @@
 import org.onosproject.net.flow.TrafficSelector;
 import org.onosproject.net.flow.TrafficTreatment;
 
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
+import com.google.common.base.MoreObjects;
+import com.google.common.collect.ImmutableSet;
 
 /**
  * Abstraction of a connectivity intent that is implemented by a set of path
@@ -42,71 +41,21 @@
     /**
      * Creates a new actionable intent capable of funneling the selected
      * traffic along the specified convergent tree and out the given egress
-     * point.
-     *
-     * @param appId       application identifier
-     * @param selector    traffic match
-     * @param treatment   action
-     * @param links       traversed links
-     * @param ingressPoint ingress point
-     * @param egressPoint egress point
-     * @throws NullPointerException {@code path} is null
-     */
-    public LinkCollectionIntent(ApplicationId appId,
-                                TrafficSelector selector,
-                                TrafficTreatment treatment,
-                                Set<Link> links,
-                                ConnectPoint ingressPoint,
-                                ConnectPoint egressPoint) {
-        this(appId, selector, treatment, links, ingressPoint, egressPoint,
-             Collections.emptyList(), DEFAULT_INTENT_PRIORITY);
-    }
-
-    /**
-     * Creates a new actionable intent capable of funneling the selected
-     * traffic along the specified convergent tree and out the given egress
      * point satisfying the specified constraints.
      *
      * @param appId       application identifier
+     * @param key         key to use for the intent
      * @param selector    traffic match
      * @param treatment   action
      * @param links       traversed links
-     * @param ingressPoint ingress point
-     * @param egressPoint egress point
+     * @param ingressPoints ingress points
+     * @param egressPoints egress points
      * @param constraints optional list of constraints
      * @param priority    priority to use for the flows generated by this intent
      * @throws NullPointerException {@code path} is null
      */
-    public LinkCollectionIntent(ApplicationId appId,
-                                TrafficSelector selector,
-                                TrafficTreatment treatment,
-                                Set<Link> links,
-                                ConnectPoint ingressPoint,
-                                ConnectPoint egressPoint,
-                                List<Constraint> constraints,
-                                int priority) {
-        super(appId, resources(links), selector, treatment, constraints, priority);
-        this.links = links;
-        this.ingressPoints = ImmutableSet.of(ingressPoint);
-        this.egressPoints = ImmutableSet.of(egressPoint);
-    }
-
-    /**
-     * Creates a new actionable intent capable of funneling the selected
-     * traffic along the specified convergent tree and out the given egress
-     * point.
-     *
-     * @param appId        application identifier
-     * @param selector     traffic match
-     * @param treatment    action
-     * @param links        traversed links
-     * @param ingressPoints Set of ingress points
-     * @param egressPoints Set of egress points
-     * @param constraints  the constraints
-     * @param priority     priority to use for the flows generated by this intent
-     * @throws NullPointerException {@code path} is null
-     */
-    public LinkCollectionIntent(ApplicationId appId,
+    private LinkCollectionIntent(ApplicationId appId,
+                                Key key,
                                 TrafficSelector selector,
                                 TrafficTreatment treatment,
                                 Set<Link> links,
@@ -114,11 +63,10 @@
                                 Set<ConnectPoint> egressPoints,
                                 List<Constraint> constraints,
                                 int priority) {
-        super(appId, resources(links), selector, treatment, constraints, priority);
-
+        super(appId, key, resources(links), selector, treatment, constraints, priority);
         this.links = links;
-        this.ingressPoints = ImmutableSet.copyOf(ingressPoints);
-        this.egressPoints = ImmutableSet.copyOf(egressPoints);
+        this.ingressPoints = ingressPoints;
+        this.egressPoints = egressPoints;
     }
 
     /**
@@ -132,6 +80,120 @@
     }
 
     /**
+     * Returns a new link collection intent builder. The application id,
+     * ingress point and egress points are required fields.  If they are
+     * not set by calls to the appropriate methods, an exception will
+     * be thrown.
+     *
+     * @return single point to multi point builder
+     */
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder of a single point to multi point intent.
+     */
+    public static final class Builder extends ConnectivityIntent.Builder {
+        Set<Link> links;
+        Set<ConnectPoint> ingressPoints;
+        Set<ConnectPoint> egressPoints;
+
+        private Builder() {
+            // Hide constructor
+        }
+
+        @Override
+        public Builder appId(ApplicationId appId) {
+            return (Builder) super.appId(appId);
+        }
+
+        @Override
+        public Builder key(Key key) {
+            return (Builder) super.key(key);
+        }
+
+        @Override
+        public Builder selector(TrafficSelector selector) {
+            return (Builder) super.selector(selector);
+        }
+
+        @Override
+        public Builder treatment(TrafficTreatment treatment) {
+            return (Builder) super.treatment(treatment);
+        }
+
+        @Override
+        public Builder constraints(List<Constraint> constraints) {
+            return (Builder) super.constraints(constraints);
+        }
+
+        @Override
+        public Builder priority(int priority) {
+            return (Builder) super.priority(priority);
+        }
+
+        /**
+         * Sets the ingress point of the single point to multi point intent
+         * that will be built.
+         *
+         * @param ingressPoints ingress connect points
+         * @return this builder
+         */
+        public Builder ingressPoints(Set<ConnectPoint> ingressPoints) {
+            this.ingressPoints = ImmutableSet.copyOf(ingressPoints);
+            return this;
+        }
+
+        /**
+         * Sets the egress points of the single point to multi point intent
+         * that will be built.
+         *
+         * @param egressPoints egress connect points
+         * @return this builder
+         */
+        public Builder egressPoints(Set<ConnectPoint> egressPoints) {
+            this.egressPoints = ImmutableSet.copyOf(egressPoints);
+            return this;
+        }
+
+        /**
+         * Sets the links of the link collection intent
+         * that will be built.
+         *
+         * @param links links for the intent
+         * @return this builder
+         */
+        public Builder links(Set<Link> links) {
+            this.links = ImmutableSet.copyOf(links);
+            return this;
+        }
+
+
+        /**
+         * Builds a single point to multi point intent from the
+         * accumulated parameters.
+         *
+         * @return point to point intent
+         */
+        public LinkCollectionIntent build() {
+
+            return new LinkCollectionIntent(
+                    appId,
+                    key,
+                    selector,
+                    treatment,
+                    links,
+                    ingressPoints,
+                    egressPoints,
+                    constraints,
+                    priority
+            );
+        }
+    }
+
+
+    /**
      * Returns the set of links that represent the network connections needed
      * by this intent.
      *
diff --git a/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java b/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java
index 524b231..1625f58 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java
@@ -1,8 +1,5 @@
 package org.onosproject.net.intent;
 
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
@@ -10,13 +7,13 @@
 import org.onlab.packet.MplsLabel;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.Link;
 import org.onosproject.net.flow.TrafficSelector;
 import org.onosproject.net.flow.TrafficTreatment;
-import org.onosproject.net.intent.constraint.LinkTypeConstraint;
 
 import com.google.common.base.MoreObjects;
-import com.google.common.collect.ImmutableList;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 
 /**
@@ -30,30 +27,6 @@
     private final Optional<MplsLabel> egressLabel;
 
     /**
-     * Creates a new MPLS intent with the supplied ingress/egress
-     * ports and labels and with built-in link type constraint to avoid optical links.
-     *
-     * @param appId        application identifier
-     * @param selector     traffic selector
-     * @param treatment    treatment
-     * @param ingressPoint ingress port
-     * @param ingressLabel ingress MPLS label
-     * @param egressPoint  egress port
-     * @param egressLabel  egress MPLS label
-     * @throws NullPointerException if {@code ingressPoint} or {@code egressPoints} is null.
-     */
-    public MplsIntent(ApplicationId appId, TrafficSelector selector,
-                              TrafficTreatment treatment,
-                              ConnectPoint ingressPoint,
-                              Optional<MplsLabel> ingressLabel,
-                              ConnectPoint egressPoint,
-                              Optional<MplsLabel> egressLabel) {
-        this(appId, selector, treatment, ingressPoint, ingressLabel, egressPoint, egressLabel,
-             ImmutableList.of(new LinkTypeConstraint(false, Link.Type.OPTICAL)),
-             DEFAULT_INTENT_PRIORITY);
-    }
-
-    /**
      * Creates a new point-to-point intent with the supplied ingress/egress
      * ports, labels and constraints.
      *
@@ -68,32 +41,154 @@
      * @param priority    priority to use for flows generated by this intent
      * @throws NullPointerException if {@code ingressPoint} or {@code egressPoints} is null.
      */
-    public MplsIntent(ApplicationId appId, TrafficSelector selector,
-                              TrafficTreatment treatment,
-                              ConnectPoint ingressPoint,
-                              Optional<MplsLabel> ingressLabel,
-                              ConnectPoint egressPoint,
-                              Optional<MplsLabel> egressLabel,
-                              List<Constraint> constraints,
-                              int priority) {
+    private MplsIntent(ApplicationId appId,
+                      Key key,
+                      TrafficSelector selector,
+                      TrafficTreatment treatment,
+                      ConnectPoint ingressPoint,
+                      Optional<MplsLabel> ingressLabel,
+                      ConnectPoint egressPoint,
+                      Optional<MplsLabel> egressLabel,
+                      List<Constraint> constraints,
+                      int priority) {
 
-        super(appId, Collections.emptyList(), selector, treatment, constraints,
+        super(appId, key, Collections.emptyList(), selector, treatment, constraints,
               priority);
 
-        checkNotNull(ingressPoint);
-        checkNotNull(egressPoint);
-        checkArgument(!ingressPoint.equals(egressPoint),
-                "ingress and egress should be different (ingress: %s, egress: %s)", ingressPoint, egressPoint);
-        checkNotNull(ingressLabel);
-        checkNotNull(egressLabel);
-        this.ingressPoint = ingressPoint;
-        this.ingressLabel = ingressLabel;
-        this.egressPoint = egressPoint;
-        this.egressLabel = egressLabel;
+        this.ingressPoint = checkNotNull(ingressPoint);
+        this.ingressLabel = checkNotNull(ingressLabel);
+        this.egressPoint = checkNotNull(egressPoint);
+        this.egressLabel = checkNotNull(egressLabel);
 
+        checkArgument(!ingressPoint.equals(egressPoint),
+                "ingress and egress should be different (ingress: %s, egress: %s)",
+                ingressPoint, egressPoint);
     }
 
     /**
+     * Returns a new MPLS intent builder. The application id,
+     * ingress point, egress point, ingress label and egress label are
+     * required fields.  If they are not set by calls to the appropriate
+     * methods, an exception will be thrown.
+     *
+     * @return point to point builder
+     */
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder of an MPLS intent.
+     */
+    public static final class Builder extends ConnectivityIntent.Builder {
+        ConnectPoint ingressPoint;
+        ConnectPoint egressPoint;
+        Optional<MplsLabel> ingressLabel;
+        Optional<MplsLabel> egressLabel;
+
+        private Builder() {
+            // Hide constructor
+        }
+
+        @Override
+        public Builder appId(ApplicationId appId) {
+            return (Builder) super.appId(appId);
+        }
+
+        @Override
+        public Builder key(Key key) {
+            return (Builder) super.key(key);
+        }
+
+        @Override
+        public Builder selector(TrafficSelector selector) {
+            return (Builder) super.selector(selector);
+        }
+
+        @Override
+        public Builder treatment(TrafficTreatment treatment) {
+            return (Builder) super.treatment(treatment);
+        }
+
+        @Override
+        public Builder constraints(List<Constraint> constraints) {
+            return (Builder) super.constraints(constraints);
+        }
+
+        @Override
+        public Builder priority(int priority) {
+            return (Builder) super.priority(priority);
+        }
+
+        /**
+         * Sets the ingress point of the point to point intent that will be built.
+         *
+         * @param ingressPoint ingress connect point
+         * @return this builder
+         */
+        public Builder ingressPoint(ConnectPoint ingressPoint) {
+            this.ingressPoint = ingressPoint;
+            return this;
+        }
+
+        /**
+         * Sets the egress point of the point to point intent that will be built.
+         *
+         * @param egressPoint egress connect point
+         * @return this builder
+         */
+        public Builder egressPoint(ConnectPoint egressPoint) {
+            this.egressPoint = egressPoint;
+            return this;
+        }
+
+        /**
+         * Sets the ingress label of the intent that will be built.
+         *
+         * @param ingressLabel ingress label
+         * @return this builder
+         */
+        public Builder ingressLabel(Optional<MplsLabel> ingressLabel) {
+            this.ingressLabel = ingressLabel;
+            return this;
+        }
+
+        /**
+         * Sets the ingress label of the intent that will be built.
+         *
+         * @param egressLabel ingress label
+         * @return this builder
+         */
+        public Builder egressLabel(Optional<MplsLabel> egressLabel) {
+            this.egressLabel = egressLabel;
+            return this;
+        }
+
+        /**
+         * Builds a point to point intent from the accumulated parameters.
+         *
+         * @return point to point intent
+         */
+        public MplsIntent build() {
+
+            return new MplsIntent(
+                    appId,
+                    key,
+                    selector,
+                    treatment,
+                    ingressPoint,
+                    ingressLabel,
+                    egressPoint,
+                    egressLabel,
+                    constraints,
+                    priority
+            );
+        }
+    }
+
+
+
+    /**
      * Constructor for serializer.
      */
     protected MplsIntent() {
@@ -147,6 +242,7 @@
         return MoreObjects.toStringHelper(getClass())
                 .add("id", id())
                 .add("appId", appId())
+                .add("key", key())
                 .add("priority", priority())
                 .add("selector", selector())
                 .add("treatment", treatment())
diff --git a/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java b/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java
index 83e9218..1ea5829 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java
@@ -1,18 +1,16 @@
 package org.onosproject.net.intent;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 
-
 import org.onlab.packet.MplsLabel;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.net.Path;
 import org.onosproject.net.flow.TrafficSelector;
 import org.onosproject.net.flow.TrafficTreatment;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 
 /**
  * Abstraction of explicit MPLS label-switched path.
@@ -33,44 +31,121 @@
      * @param path traversed links
      * @param ingressLabel MPLS egress label
      * @param egressLabel MPLS ingress label
-     * @throws NullPointerException {@code path} is null
-     */
-    public MplsPathIntent(ApplicationId appId, TrafficSelector selector,
-            TrafficTreatment treatment, Path path, Optional<MplsLabel> ingressLabel,
-            Optional<MplsLabel> egressLabel) {
-        this(appId, selector, treatment, path, ingressLabel, egressLabel,
-             Collections.emptyList(), DEFAULT_INTENT_PRIORITY);
-
-    }
-
-    /**
-     * Creates a new point-to-point intent with the supplied ingress/egress
-     * ports and using the specified explicit path.
-     *
-     * @param appId application identifier
-     * @param selector traffic selector
-     * @param treatment treatment
-     * @param path traversed links
-     * @param ingressLabel MPLS egress label
-     * @param egressLabel MPLS ingress label
      * @param constraints optional list of constraints
      * @param priority    priority to use for flows generated by this intent
      * @throws NullPointerException {@code path} is null
      */
-    public MplsPathIntent(ApplicationId appId, TrafficSelector selector,
+    private MplsPathIntent(ApplicationId appId, TrafficSelector selector,
             TrafficTreatment treatment, Path path, Optional<MplsLabel> ingressLabel,
             Optional<MplsLabel> egressLabel, List<Constraint> constraints,
             int priority) {
         super(appId, selector, treatment, path, constraints,
               priority);
 
-        checkNotNull(ingressLabel);
-        checkNotNull(egressLabel);
-        this.ingressLabel = ingressLabel;
-        this.egressLabel = egressLabel;
+        this.ingressLabel = checkNotNull(ingressLabel);
+        this.egressLabel = checkNotNull(egressLabel);
     }
 
     /**
+     * Returns a new host to host intent builder.
+     *
+     * @return host to host intent builder
+     */
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder of a host to host intent.
+     */
+    public static final class Builder extends PathIntent.Builder {
+        private Optional<MplsLabel> ingressLabel = Optional.empty();
+        private Optional<MplsLabel> egressLabel = Optional.empty();
+
+        private Builder() {
+            // Hide constructor
+        }
+
+        @Override
+        public Builder appId(ApplicationId appId) {
+            return (Builder) super.appId(appId);
+        }
+
+        @Override
+        public Builder key(Key key) {
+            return (Builder) super.key(key);
+        }
+
+        @Override
+        public Builder selector(TrafficSelector selector) {
+            return (Builder) super.selector(selector);
+        }
+
+        @Override
+        public Builder treatment(TrafficTreatment treatment) {
+            return (Builder) super.treatment(treatment);
+        }
+
+        @Override
+        public Builder constraints(List<Constraint> constraints) {
+            return (Builder) super.constraints(constraints);
+        }
+
+        @Override
+        public Builder priority(int priority) {
+            return (Builder) super.priority(priority);
+        }
+
+        @Override
+        public Builder path(Path path) {
+            return (Builder) super.path(path);
+        }
+
+        /**
+         * Sets the ingress label of the intent that will be built.
+         *
+         * @param ingressLabel ingress label
+         * @return this builder
+         */
+        public Builder ingressLabel(Optional<MplsLabel> ingressLabel) {
+            this.ingressLabel = ingressLabel;
+            return this;
+        }
+
+        /**
+         * Sets the ingress label of the intent that will be built.
+         *
+         * @param egressLabel ingress label
+         * @return this builder
+         */
+        public Builder egressLabel(Optional<MplsLabel> egressLabel) {
+            this.egressLabel = egressLabel;
+            return this;
+        }
+
+
+        /**
+         * Builds a host to host intent from the accumulated parameters.
+         *
+         * @return point to point intent
+         */
+        public MplsPathIntent build() {
+
+            return new MplsPathIntent(
+                    appId,
+                    selector,
+                    treatment,
+                    path,
+                    ingressLabel,
+                    egressLabel,
+                    constraints,
+                    priority
+            );
+        }
+    }
+
+
+    /**
      * Returns the MPLS label which the ingress traffic should tagged.
      *
      * @return ingress MPLS label
diff --git a/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java b/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java
index 721ff17..c92898e 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java
@@ -16,6 +16,7 @@
 package org.onosproject.net.intent;
 
 import com.google.common.base.MoreObjects;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Sets;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.net.ConnectPoint;
@@ -42,29 +43,6 @@
      * traffic selector and treatment.
      *
      * @param appId         application identifier
-     * @param selector      traffic selector
-     * @param treatment     treatment
-     * @param ingressPoints set of ports from which ingress traffic originates
-     * @param egressPoint   port to which traffic will egress
-     * @throws NullPointerException     if {@code ingressPoints} or
-     *                                  {@code egressPoint} is null.
-     * @throws IllegalArgumentException if the size of {@code ingressPoints} is
-     *                                  not more than 1
-     */
-    public MultiPointToSinglePointIntent(ApplicationId appId,
-                                         TrafficSelector selector,
-                                         TrafficTreatment treatment,
-                                         Set<ConnectPoint> ingressPoints,
-                                         ConnectPoint egressPoint) {
-        this(appId, selector, treatment, ingressPoints, egressPoint,
-                Collections.emptyList(), DEFAULT_INTENT_PRIORITY);
-    }
-
-    /**
-     * Creates a new multi-to-single point connectivity intent for the specified
-     * traffic selector and treatment.
-     *
-     * @param appId         application identifier
      * @param key           intent key
      * @param selector      traffic selector
      * @param treatment     treatment
@@ -77,7 +55,7 @@
      * @throws IllegalArgumentException if the size of {@code ingressPoints} is
      *                                  not more than 1
      */
-    public MultiPointToSinglePointIntent(ApplicationId appId,
+    private MultiPointToSinglePointIntent(ApplicationId appId,
                                          Key key,
                                          TrafficSelector selector,
                                          TrafficTreatment treatment,
@@ -99,33 +77,6 @@
     }
 
     /**
-     * Creates a new multi-to-single point connectivity intent for the specified
-     * traffic selector and treatment.
-     *
-     * @param appId         application identifier
-     * @param selector      traffic selector
-     * @param treatment     treatment
-     * @param ingressPoints set of ports from which ingress traffic originates
-     * @param egressPoint   port to which traffic will egress
-     * @param constraints   constraints to apply to the intent
-     * @param priority      priority to use for flows generated by this intent
-     * @throws NullPointerException     if {@code ingressPoints} or
-     *                                  {@code egressPoint} is null.
-     * @throws IllegalArgumentException if the size of {@code ingressPoints} is
-     *                                  not more than 1
-     */
-    public MultiPointToSinglePointIntent(ApplicationId appId,
-                                         TrafficSelector selector,
-                                         TrafficTreatment treatment,
-                                         Set<ConnectPoint> ingressPoints,
-                                         ConnectPoint egressPoint,
-                                         List<Constraint> constraints,
-                                         int priority) {
-        this(appId, null, selector, treatment, ingressPoints, egressPoint,
-                constraints, priority);
-    }
-
-    /**
      * Constructor for serializer.
      */
     protected MultiPointToSinglePointIntent() {
@@ -135,6 +86,105 @@
     }
 
     /**
+     * Returns a new multi point to single point intent builder. The application id,
+     * ingress points and egress point are required fields.  If they are
+     * not set by calls to the appropriate methods, an exception will
+     * be thrown.
+     *
+     * @return single point to multi point builder
+     */
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder of a multi point to single point intent.
+     */
+    public static final class Builder extends ConnectivityIntent.Builder {
+        Set<ConnectPoint> ingressPoints;
+        ConnectPoint egressPoint;
+
+        private Builder() {
+            // Hide constructor
+        }
+
+        @Override
+        public Builder appId(ApplicationId appId) {
+            return (Builder) super.appId(appId);
+        }
+
+        @Override
+        public Builder key(Key key) {
+            return (Builder) super.key(key);
+        }
+
+        @Override
+        public Builder selector(TrafficSelector selector) {
+            return (Builder) super.selector(selector);
+        }
+
+        @Override
+        public Builder treatment(TrafficTreatment treatment) {
+            return (Builder) super.treatment(treatment);
+        }
+
+        @Override
+        public Builder constraints(List<Constraint> constraints) {
+            return (Builder) super.constraints(constraints);
+        }
+
+        @Override
+        public Builder priority(int priority) {
+            return (Builder) super.priority(priority);
+        }
+
+        /**
+         * Sets the ingress point of the single point to multi point intent
+         * that will be built.
+         *
+         * @param ingressPoints ingress connect points
+         * @return this builder
+         */
+        public Builder ingressPoints(Set<ConnectPoint> ingressPoints) {
+            this.ingressPoints = ImmutableSet.copyOf(ingressPoints);
+            return this;
+        }
+
+        /**
+         * Sets the egress point of the multi point to single point intent
+         * that will be built.
+         *
+         * @param egressPoint egress connect point
+         * @return this builder
+         */
+        public Builder egressPoint(ConnectPoint egressPoint) {
+            this.egressPoint = egressPoint;
+            return this;
+        }
+
+        /**
+         * Builds a multi point to single point intent from the
+         * accumulated parameters.
+         *
+         * @return point to point intent
+         */
+        public MultiPointToSinglePointIntent build() {
+
+            return new MultiPointToSinglePointIntent(
+                    appId,
+                    key,
+                    selector,
+                    treatment,
+                    ingressPoints,
+                    egressPoint,
+                    constraints,
+                    priority
+            );
+        }
+    }
+
+
+    /**
      * Returns the set of ports on which ingress traffic should be connected to
      * the egress port.
      *
diff --git a/core/api/src/main/java/org/onosproject/net/intent/OpticalPathIntent.java b/core/api/src/main/java/org/onosproject/net/intent/OpticalPathIntent.java
index 6804c86..4843877 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/OpticalPathIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/OpticalPathIntent.java
@@ -24,6 +24,8 @@
 
 import java.util.Collection;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 public final class OpticalPathIntent extends Intent {
 
     private final ConnectPoint src;
@@ -35,10 +37,11 @@
             ConnectPoint src,
             ConnectPoint dst,
             Path path) {
-        super(appId, ImmutableSet.copyOf(path.links()));
-        this.src = src;
-        this.dst = dst;
-        this.path = path;
+        super(appId, null, ImmutableSet.copyOf(path.links()),
+                Intent.DEFAULT_INTENT_PRIORITY);
+        this.src = checkNotNull(src);
+        this.dst = checkNotNull(dst);
+        this.path = checkNotNull(path);
     }
 
     protected OpticalPathIntent() {
@@ -69,6 +72,7 @@
         return MoreObjects.toStringHelper(getClass())
                 .add("id", id())
                 .add("appId", appId())
+                .add("key", key())
                 .add("resources", resources())
                 .add("ingressPort", src)
                 .add("egressPort", dst)
diff --git a/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java b/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java
index 13fa61e..1cb960f 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java
@@ -15,17 +15,17 @@
  */
 package org.onosproject.net.intent;
 
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
+import java.util.List;
+
 import org.onosproject.core.ApplicationId;
 import org.onosproject.net.Link;
 import org.onosproject.net.Path;
 import org.onosproject.net.flow.TrafficSelector;
 import org.onosproject.net.flow.TrafficTreatment;
 
-import java.util.Collections;
-import java.util.List;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
@@ -44,30 +44,17 @@
      * @param selector  traffic selector
      * @param treatment treatment
      * @param path      traversed links
-     * @throws NullPointerException {@code path} is null
-     */
-    public PathIntent(ApplicationId appId, TrafficSelector selector,
-                      TrafficTreatment treatment, Path path) {
-        this(appId, selector, treatment, path, Collections.emptyList(),
-                DEFAULT_INTENT_PRIORITY);
-    }
-
-    /**
-     * Creates a new point-to-point intent with the supplied ingress/egress
-     * ports and using the specified explicit path.
-     *
-     * @param appId     application identifier
-     * @param selector  traffic selector
-     * @param treatment treatment
-     * @param path      traversed links
      * @param constraints  optional list of constraints
      * @param priority  priority to use for the generated flows
      * @throws NullPointerException {@code path} is null
      */
-    public PathIntent(ApplicationId appId, TrafficSelector selector,
-                      TrafficTreatment treatment, Path path, List<Constraint> constraints,
-                      int priority) {
-        super(appId, resources(path.links()), selector, treatment, constraints,
+    protected PathIntent(ApplicationId appId,
+                         TrafficSelector selector,
+                         TrafficTreatment treatment,
+                         Path path,
+                         List<Constraint> constraints,
+                         int priority) {
+        super(appId, null, resources(path.links()), selector, treatment, constraints,
                 priority);
         PathIntent.validate(path.links());
         this.path = path;
@@ -81,6 +68,86 @@
         this.path = null;
     }
 
+    /**
+     * Returns a new host to host intent builder.
+     *
+     * @return host to host intent builder
+     */
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder of a host to host intent.
+     */
+    public static class Builder extends ConnectivityIntent.Builder {
+        Path path;
+
+        protected Builder() {
+            // Hide default constructor
+        }
+
+        @Override
+        public Builder appId(ApplicationId appId) {
+            return (Builder) super.appId(appId);
+        }
+
+        @Override
+        public Builder key(Key key) {
+            return (Builder) super.key(key);
+        }
+
+        @Override
+        public Builder selector(TrafficSelector selector) {
+            return (Builder) super.selector(selector);
+        }
+
+        @Override
+        public Builder treatment(TrafficTreatment treatment) {
+            return (Builder) super.treatment(treatment);
+        }
+
+        @Override
+        public Builder constraints(List<Constraint> constraints) {
+            return (Builder) super.constraints(constraints);
+        }
+
+        @Override
+        public Builder priority(int priority) {
+            return (Builder) super.priority(priority);
+        }
+
+        /**
+         * Sets the path of the intent that will be built.
+         *
+         * @param path path for the intent
+         * @return this builder
+         */
+        public Builder path(Path path) {
+            this.path = path;
+            return this;
+        }
+
+        /**
+         * Builds a path intent from the accumulated parameters.
+         *
+         * @return point to point intent
+         */
+        public PathIntent build() {
+
+            return new PathIntent(
+                    appId,
+                    selector,
+                    treatment,
+                    path,
+                    constraints,
+                    priority
+            );
+        }
+    }
+
+
+
     // NOTE: This methods takes linear time with the number of links.
     /**
      * Validates that source element ID and destination element ID of a link are
diff --git a/core/api/src/main/java/org/onosproject/net/intent/PointToPointIntent.java b/core/api/src/main/java/org/onosproject/net/intent/PointToPointIntent.java
index 5f80d9a..5439121 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/PointToPointIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/PointToPointIntent.java
@@ -159,13 +159,11 @@
         super(appId, key, Collections.emptyList(), selector, treatment, constraints,
                 priority);
 
-        checkNotNull(ingressPoint);
-        checkNotNull(egressPoint);
         checkArgument(!ingressPoint.equals(egressPoint),
                 "ingress and egress should be different (ingress: %s, egress: %s)", ingressPoint, egressPoint);
 
-        this.ingressPoint = ingressPoint;
-        this.egressPoint = egressPoint;
+        this.ingressPoint = checkNotNull(ingressPoint);
+        this.egressPoint = checkNotNull(egressPoint);
     }
 
     /**
diff --git a/core/api/src/main/java/org/onosproject/net/intent/SinglePointToMultiPointIntent.java b/core/api/src/main/java/org/onosproject/net/intent/SinglePointToMultiPointIntent.java
index 129c4a6..a58d3af 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/SinglePointToMultiPointIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/SinglePointToMultiPointIntent.java
@@ -16,7 +16,7 @@
 package org.onosproject.net.intent;
 
 import com.google.common.base.MoreObjects;
-import com.google.common.collect.Sets;
+import com.google.common.collect.ImmutableSet;
 
 import org.onosproject.core.ApplicationId;
 import org.onosproject.net.ConnectPoint;
@@ -42,27 +42,6 @@
      * Creates a new single-to-multi point connectivity intent.
      *
      * @param appId application identifier
-     * @param selector traffic selector
-     * @param treatment treatment
-     * @param ingressPoint port on which traffic will ingress
-     * @param egressPoints set of ports on which traffic will egress
-     * @throws NullPointerException if {@code ingressPoint} or
-     *             {@code egressPoints} is null
-     * @throws IllegalArgumentException if the size of {@code egressPoints} is
-     *             not more than 1
-     */
-    public SinglePointToMultiPointIntent(ApplicationId appId,
-            TrafficSelector selector, TrafficTreatment treatment,
-            ConnectPoint ingressPoint, Set<ConnectPoint> egressPoints) {
-        this(appId, null, selector, treatment, ingressPoint, egressPoints,
-                Collections.emptyList(),
-                DEFAULT_INTENT_PRIORITY);
-    }
-
-    /**
-     * Creates a new single-to-multi point connectivity intent.
-     *
-     * @param appId application identifier
      * @param key intent key
      * @param selector traffic selector
      * @param treatment treatment
@@ -75,7 +54,7 @@
      * @throws IllegalArgumentException if the size of {@code egressPoints} is
      *             not more than 1
      */
-    public SinglePointToMultiPointIntent(ApplicationId appId,
+    private SinglePointToMultiPointIntent(ApplicationId appId,
             Key key,
             TrafficSelector selector, TrafficTreatment treatment,
             ConnectPoint ingressPoint, Set<ConnectPoint> egressPoints,
@@ -90,7 +69,105 @@
                 "Set of egresses should not contain ingress (ingress: %s)", ingressPoint);
 
         this.ingressPoint = checkNotNull(ingressPoint);
-        this.egressPoints = Sets.newHashSet(egressPoints);
+        this.egressPoints = egressPoints;
+    }
+
+    /**
+     * Returns a new single point to multi point intent builder. The application id,
+     * ingress point and egress points are required fields.  If they are
+     * not set by calls to the appropriate methods, an exception will
+     * be thrown.
+     *
+     * @return single point to multi point builder
+     */
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder of a single point to multi point intent.
+     */
+    public static final class Builder extends ConnectivityIntent.Builder {
+        ConnectPoint ingressPoint;
+        Set<ConnectPoint> egressPoints;
+
+        private Builder() {
+            // Hide constructor
+        }
+
+        @Override
+        public Builder appId(ApplicationId appId) {
+            return (Builder) super.appId(appId);
+        }
+
+        @Override
+        public Builder key(Key key) {
+            return (Builder) super.key(key);
+        }
+
+        @Override
+        public Builder selector(TrafficSelector selector) {
+            return (Builder) super.selector(selector);
+        }
+
+        @Override
+        public Builder treatment(TrafficTreatment treatment) {
+            return (Builder) super.treatment(treatment);
+        }
+
+        @Override
+        public Builder constraints(List<Constraint> constraints) {
+            return (Builder) super.constraints(constraints);
+        }
+
+        @Override
+        public Builder priority(int priority) {
+            return (Builder) super.priority(priority);
+        }
+
+        /**
+         * Sets the ingress point of the single point to multi point intent
+         * that will be built.
+         *
+         * @param ingressPoint ingress connect point
+         * @return this builder
+         */
+        public Builder ingressPoint(ConnectPoint ingressPoint) {
+            this.ingressPoint = ingressPoint;
+            return this;
+        }
+
+        /**
+         * Sets the egress points of the single point to multi point intent
+         * that will be built.
+         *
+         * @param egressPoints egress connect points
+         * @return this builder
+         */
+        public Builder egressPoints(Set<ConnectPoint> egressPoints) {
+            this.egressPoints = ImmutableSet.copyOf(egressPoints);
+            return this;
+        }
+
+        /**
+         * Builds a single point to multi point intent from the
+         * accumulated parameters.
+         *
+         * @return point to point intent
+         */
+        public SinglePointToMultiPointIntent build() {
+
+            return new SinglePointToMultiPointIntent(
+                    appId,
+                    key,
+                    selector,
+                    treatment,
+                    ingressPoint,
+                    egressPoints,
+                    constraints,
+                    priority
+            );
+        }
     }
 
     /**
diff --git a/core/api/src/main/java/org/onosproject/net/intent/TwoWayP2PIntent.java b/core/api/src/main/java/org/onosproject/net/intent/TwoWayP2PIntent.java
index ee95255..a995758 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/TwoWayP2PIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/TwoWayP2PIntent.java
@@ -15,21 +15,16 @@
  */
 package org.onosproject.net.intent;
 
-import com.google.common.base.MoreObjects;
-import com.google.common.collect.ImmutableList;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.HostId;
-import org.onosproject.net.Link;
-import org.onosproject.net.flow.DefaultTrafficSelector;
-import org.onosproject.net.flow.DefaultTrafficTreatment;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
-import org.onosproject.net.intent.constraint.LinkTypeConstraint;
-
 import java.util.Collections;
 import java.util.List;
 
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.flow.TrafficSelector;
+import org.onosproject.net.flow.TrafficTreatment;
+
+import com.google.common.base.MoreObjects;
+
 import static com.google.common.base.Preconditions.checkNotNull;
 
 /**
@@ -40,45 +35,12 @@
     private final ConnectPoint one;
     private final ConnectPoint two;
 
-    /**
-     * Creates a new two way host-to-host intent with the supplied host pair and no
-     * other traffic selection or treatment criteria.
-     *
-     * @param appId     application identifier
-     * @param one       first host
-     * @param two       second host
-     * @throws NullPointerException if {@code one} or {@code two} is null.
-     */
-    public TwoWayP2PIntent(ApplicationId appId, ConnectPoint one, ConnectPoint two) {
-        this(appId, one, two,
-             DefaultTrafficSelector.emptySelector(),
-             DefaultTrafficTreatment.emptyTreatment(),
-             ImmutableList.of(new LinkTypeConstraint(false, Link.Type.OPTICAL)),
-             DEFAULT_INTENT_PRIORITY);
-    }
-
-    /**
-     * Creates a new host-to-host intent with the supplied host pair.
-     *
-     * @param appId     application identifier
-     * @param one       first host
-     * @param two       second host
-     * @param selector  action
-     * @param treatment ingress port
-     * @throws NullPointerException if {@code one} or {@code two} is null.
-     */
-    public TwoWayP2PIntent(ApplicationId appId, ConnectPoint one, ConnectPoint two,
-                           TrafficSelector selector,
-                           TrafficTreatment treatment) {
-        this(appId, one, two, selector, treatment,
-             ImmutableList.of(new LinkTypeConstraint(false, Link.Type.OPTICAL)),
-             DEFAULT_INTENT_PRIORITY);
-    }
 
     /**
      * Creates a new host-to-host intent with the supplied host pair.
      *
      * @param appId       application identifier
+     * @param key         intent key
      * @param one         first host
      * @param two         second host
      * @param selector    action
@@ -87,27 +49,7 @@
      * @param priority    priority to use for flows generated by this intent
      * @throws NullPointerException if {@code one} or {@code two} is null.
      */
-    public TwoWayP2PIntent(ApplicationId appId, ConnectPoint one, ConnectPoint two,
-                           TrafficSelector selector,
-                           TrafficTreatment treatment,
-                           List<Constraint> constraints,
-                           int priority) {
-        this(appId, null, one, two, selector, treatment, constraints, priority);
-    }
-    /**
-     * Creates a new host-to-host intent with the supplied host pair.
-     *
-     * @param appId       application identifier
-     * @param key       intent key
-     * @param one         first host
-     * @param two         second host
-     * @param selector    action
-     * @param treatment   ingress port
-     * @param constraints optional prioritized list of path selection constraints
-     * @param priority    priority to use for flows generated by this intent
-     * @throws NullPointerException if {@code one} or {@code two} is null.
-     */
-    public TwoWayP2PIntent(ApplicationId appId, Key key,
+    private TwoWayP2PIntent(ApplicationId appId, Key key,
                            ConnectPoint one, ConnectPoint two,
                            TrafficSelector selector,
                            TrafficTreatment treatment,
@@ -122,12 +64,96 @@
 
     }
 
-    private static HostId min(HostId one, HostId two) {
-        return one.hashCode() < two.hashCode() ? one : two;
+    /**
+     * Returns a new two way intent builder.
+     *
+     * @return two way intent builder
+     */
+    public static Builder builder() {
+        return new Builder();
     }
 
-    private static HostId max(HostId one, HostId two) {
-        return one.hashCode() >= two.hashCode() ? one : two;
+    /**
+     * Builder of a point to point intent.
+     */
+    public static final class Builder extends ConnectivityIntent.Builder {
+        ConnectPoint one;
+        ConnectPoint two;
+
+        private Builder() {
+            // Hide constructor
+        }
+
+        @Override
+        public Builder appId(ApplicationId appId) {
+            return (Builder) super.appId(appId);
+        }
+
+        @Override
+        public Builder key(Key key) {
+            return (Builder) super.key(key);
+        }
+
+        @Override
+        public Builder selector(TrafficSelector selector) {
+            return (Builder) super.selector(selector);
+        }
+
+        @Override
+        public Builder treatment(TrafficTreatment treatment) {
+            return (Builder) super.treatment(treatment);
+        }
+
+        @Override
+        public Builder constraints(List<Constraint> constraints) {
+            return (Builder) super.constraints(constraints);
+        }
+
+        @Override
+        public Builder priority(int priority) {
+            return (Builder) super.priority(priority);
+        }
+
+        /**
+         * Sets the first connection point of the two way intent that will be built.
+         *
+         * @param one first connect point
+         * @return this builder
+         */
+        public Builder one(ConnectPoint one) {
+            this.one = one;
+            return this;
+        }
+
+        /**
+         * Sets the second connection point of the two way intent that will be built.
+         *
+         * @param two second connect point
+         * @return this builder
+         */
+        public Builder two(ConnectPoint two) {
+            this.two = two;
+            return this;
+        }
+
+        /**
+         * Builds a point to point intent from the accumulated parameters.
+         *
+         * @return point to point intent
+         */
+        public TwoWayP2PIntent build() {
+
+            return new TwoWayP2PIntent(
+                    appId,
+                    key,
+                    one,
+                    two,
+                    selector,
+                    treatment,
+                    constraints,
+                    priority
+            );
+        }
     }
 
     /**
diff --git a/core/api/src/test/java/org/onosproject/net/intent/HostToHostIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/HostToHostIntentTest.java
index c476144..31d6c4d 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/HostToHostIntentTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/HostToHostIntentTest.java
@@ -27,7 +27,6 @@
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.is;
 import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
-import static org.onosproject.net.NetTestTools.APP_ID;
 import static org.onosproject.net.NetTestTools.hid;
 
 /**
@@ -43,7 +42,13 @@
     private static final ApplicationId APPID = new TestApplicationId("foo");
 
     private HostToHostIntent makeHostToHost(HostId one, HostId two) {
-        return new HostToHostIntent(APPID, one, two, selector, treatment);
+        return HostToHostIntent.builder()
+                .appId(APPID)
+                .one(one)
+                .two(two)
+                .selector(selector)
+                .treatment(treatment)
+                .build();
     }
 
     /**
@@ -75,17 +80,21 @@
      */
     @Test
     public void testEquals() {
-        final HostToHostIntent intent1 = new HostToHostIntent(APP_ID,
-                id1,
-                id2,
-                selector,
-                treatment);
+        final HostToHostIntent intent1 = HostToHostIntent.builder()
+                .appId(APPID)
+                .one(id1)
+                .two(id2)
+                .selector(selector)
+                .treatment(treatment)
+                .build();
 
-        final HostToHostIntent intent2 = new HostToHostIntent(APP_ID,
-                id2,
-                id3,
-                selector,
-                treatment);
+        final HostToHostIntent intent2 = HostToHostIntent.builder()
+                .appId(APPID)
+                .one(id2)
+                .two(id3)
+                .selector(selector)
+                .treatment(treatment)
+                .build();
 
         new EqualsTester()
                 .addEqualityGroup(intent1)
@@ -95,11 +104,23 @@
 
     @Override
     protected Intent createOne() {
-        return new HostToHostIntent(APP_ID, id1, id2, selector, treatment);
+        return HostToHostIntent.builder()
+                .appId(APPID)
+                .one(id1)
+                .two(id2)
+                .selector(selector)
+                .treatment(treatment)
+                .build();
     }
 
     @Override
     protected Intent createAnother() {
-        return new HostToHostIntent(APP_ID, id1, id3, selector, treatment);
+        return HostToHostIntent.builder()
+                .appId(APPID)
+                .one(id1)
+                .two(id3)
+                .selector(selector)
+                .treatment(treatment)
+                .build();
     }
 }
diff --git a/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java b/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
index dca1906..4ae09fb 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
@@ -419,12 +419,13 @@
         private final Long number;
 
         public MockIntent(Long number) {
-            super(NetTestTools.APP_ID, Collections.emptyList());
+            super(NetTestTools.APP_ID, null, Collections.emptyList(),
+                    Intent.DEFAULT_INTENT_PRIORITY);
             this.number = number;
         }
 
         public MockIntent(Long number, Collection<NetworkResource> resources) {
-            super(NetTestTools.APP_ID, resources);
+            super(NetTestTools.APP_ID, null, resources, Intent.DEFAULT_INTENT_PRIORITY);
             this.number = number;
         }
 
diff --git a/core/api/src/test/java/org/onosproject/net/intent/LinkCollectionIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/LinkCollectionIntentTest.java
index a9ae782..4263531 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/LinkCollectionIntentTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/LinkCollectionIntentTest.java
@@ -67,22 +67,26 @@
         final HashSet<Link> links1 = new HashSet<>();
         links1.add(link("src", 1, "dst", 2));
         final LinkCollectionIntent collectionIntent1 =
-                new LinkCollectionIntent(APP_ID,
-                        selector,
-                        treatment,
-                        links1,
-                        ingress,
-                        egress);
+                LinkCollectionIntent.builder()
+                        .appId(APP_ID)
+                        .selector(selector)
+                        .treatment(treatment)
+                        .links(links1)
+                        .ingressPoints(ImmutableSet.of(ingress))
+                        .egressPoints(ImmutableSet.of(egress))
+                        .build();
 
         final HashSet<Link> links2 = new HashSet<>();
         links2.add(link("src", 1, "dst", 3));
         final LinkCollectionIntent collectionIntent2 =
-                new LinkCollectionIntent(APP_ID,
-                        selector,
-                        treatment,
-                        links2,
-                        ingress,
-                        egress);
+                LinkCollectionIntent.builder()
+                        .appId(APP_ID)
+                        .selector(selector)
+                        .treatment(treatment)
+                        .links(links2)
+                        .ingressPoints(ImmutableSet.of(ingress))
+                        .egressPoints(ImmutableSet.of(egress))
+                        .build();
 
         new EqualsTester()
                 .addEqualityGroup(collectionIntent1)
@@ -98,12 +102,14 @@
         final HashSet<Link> links1 = new HashSet<>();
         links1.add(link("src", 1, "dst", 2));
         final LinkCollectionIntent collectionIntent =
-                new LinkCollectionIntent(APP_ID,
-                        selector,
-                        treatment,
-                        links1,
-                        ingress,
-                        egress);
+                LinkCollectionIntent.builder()
+                        .appId(APP_ID)
+                        .selector(selector)
+                        .treatment(treatment)
+                        .links(links1)
+                        .ingressPoints(ImmutableSet.of(ingress))
+                        .egressPoints(ImmutableSet.of(egress))
+                        .build();
 
         final Set<Link> createdLinks = collectionIntent.links();
         assertThat(createdLinks, hasSize(1));
@@ -128,14 +134,16 @@
         links1.add(link("src", 1, "dst", 2));
         constraints.add(new LambdaConstraint(Lambda.valueOf(23)));
         final LinkCollectionIntent collectionIntent =
-                new LinkCollectionIntent(APP_ID,
-                        selector,
-                        treatment,
-                        links1,
-                        ingress,
-                        egress,
-                        constraints,
-                        8888);
+                LinkCollectionIntent.builder()
+                        .appId(APP_ID)
+                        .selector(selector)
+                        .treatment(treatment)
+                        .links(links1)
+                        .ingressPoints(ImmutableSet.of(ingress))
+                        .egressPoints(ImmutableSet.of(egress))
+                        .constraints(constraints)
+                        .priority(8888)
+                        .build();
 
         final Set<Link> createdLinks = collectionIntent.links();
         assertThat(createdLinks, hasSize(1));
@@ -175,23 +183,27 @@
     protected Intent createOne() {
         HashSet<Link> links1 = new HashSet<>();
         links1.add(link("src", 1, "dst", 2));
-        return new LinkCollectionIntent(APP_ID,
-                                        selector,
-                                        treatment,
-                                        links1,
-                                        ingress,
-                                        egress);
+        return LinkCollectionIntent.builder()
+                .appId(APP_ID)
+                .selector(selector)
+                .treatment(treatment)
+                .links(links1)
+                .ingressPoints(ImmutableSet.of(ingress))
+                .egressPoints(ImmutableSet.of(egress))
+                .build();
     }
 
     @Override
     protected Intent createAnother() {
         HashSet<Link> links2 = new HashSet<>();
         links2.add(link("src", 1, "dst", 3));
-        return new LinkCollectionIntent(APP_ID,
-                                        selector,
-                                        treatment,
-                                        links2,
-                                        ingress,
-                                        egress);
+        return LinkCollectionIntent.builder()
+                .appId(APP_ID)
+                .selector(selector)
+                .treatment(treatment)
+                .links(links2)
+                .ingressPoints(ImmutableSet.of(ingress))
+                .egressPoints(ImmutableSet.of(egress))
+                .build();
     }
 }
diff --git a/core/api/src/test/java/org/onosproject/net/intent/MultiPointToSinglePointIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/MultiPointToSinglePointIntentTest.java
index cab6a8d..2aac906 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/MultiPointToSinglePointIntentTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/MultiPointToSinglePointIntentTest.java
@@ -44,11 +44,23 @@
 
     @Override
     protected MultiPointToSinglePointIntent createOne() {
-        return new MultiPointToSinglePointIntent(APPID, MATCH, NOP, PS1, P2);
+        return MultiPointToSinglePointIntent.builder()
+                .appId(APPID)
+                .selector(MATCH)
+                .treatment(NOP)
+                .ingressPoints(PS1)
+                .egressPoint(P2)
+                .build();
     }
 
     @Override
     protected MultiPointToSinglePointIntent createAnother() {
-        return new MultiPointToSinglePointIntent(APPID, MATCH, NOP, PS2, P1);
+        return MultiPointToSinglePointIntent.builder()
+                .appId(APPID)
+                .selector(MATCH)
+                .treatment(NOP)
+                .ingressPoints(PS2)
+                .egressPoint(P1)
+                .build();
     }
 }
diff --git a/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java
index 6db1a35..2149b26 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java
@@ -15,6 +15,8 @@
  */
 package org.onosproject.net.intent;
 
+import java.util.Arrays;
+
 import org.junit.Test;
 import org.onosproject.net.ConnectPoint;
 import org.onosproject.net.DefaultLink;
@@ -25,8 +27,6 @@
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.provider.ProviderId;
 
-import java.util.Arrays;
-
 import static org.junit.Assert.assertEquals;
 import static org.onosproject.net.DeviceId.deviceId;
 import static org.onosproject.net.Link.Type.DIRECT;
@@ -65,12 +65,22 @@
 
     @Override
     protected PathIntent createOne() {
-        return new PathIntent(APPID, MATCH, NOP, PATH1);
+        return PathIntent.builder()
+                .appId(APPID)
+                .selector(MATCH)
+                .treatment(NOP)
+                .path(PATH1)
+                .build();
     }
 
     @Override
     protected PathIntent createAnother() {
-        return new PathIntent(APPID, MATCH, NOP, PATH2);
+        return PathIntent.builder()
+                .appId(APPID)
+                .selector(MATCH)
+                .treatment(NOP)
+                .path(PATH2)
+                .build();
     }
 
     /**
@@ -79,7 +89,12 @@
      */
     @Test(expected = IllegalArgumentException.class)
     public void testRaiseExceptionWhenSameDevices() {
-        new PathIntent(APPID, MATCH, NOP, new DefaultPath(provider1, Arrays.asList(link1), cost));
+        PathIntent.builder()
+                .appId(APPID)
+                .selector(MATCH)
+                .treatment(NOP)
+                .path(new DefaultPath(provider1, Arrays.asList(link1), cost))
+                .build();
     }
 
     /**
@@ -88,7 +103,12 @@
      */
     @Test(expected = IllegalArgumentException.class)
     public void testRaiseExceptionWhenDifferentDevice() {
-        new PathIntent(APPID, MATCH, NOP, new DefaultPath(provider1, Arrays.asList(link1, link2), cost));
+        PathIntent.builder()
+                .appId(APPID)
+                .selector(MATCH)
+                .treatment(NOP)
+                .path(new DefaultPath(provider1, Arrays.asList(link1, link2), cost))
+                .build();
     }
 
 }
diff --git a/core/api/src/test/java/org/onosproject/net/intent/SinglePointToMultiPointIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/SinglePointToMultiPointIntentTest.java
index f0f8ebf..325c4f2 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/SinglePointToMultiPointIntentTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/SinglePointToMultiPointIntentTest.java
@@ -44,11 +44,23 @@
 
     @Override
     protected SinglePointToMultiPointIntent createOne() {
-        return new SinglePointToMultiPointIntent(APPID, MATCH, NOP, P1, PS2);
+        return SinglePointToMultiPointIntent.builder()
+                .appId(APPID)
+                .selector(MATCH)
+                .treatment(NOP)
+                .ingressPoint(P1)
+                .egressPoints(PS2)
+                .build();
     }
 
     @Override
     protected SinglePointToMultiPointIntent createAnother() {
-        return new SinglePointToMultiPointIntent(APPID, MATCH, NOP, P2, PS1);
+        return SinglePointToMultiPointIntent.builder()
+                .appId(APPID)
+                .selector(MATCH)
+                .treatment(NOP)
+                .ingressPoint(P2)
+                .egressPoints(PS1)
+                .build();
     }
 }
diff --git a/core/api/src/test/java/org/onosproject/net/intent/TestInstallableIntent.java b/core/api/src/test/java/org/onosproject/net/intent/TestInstallableIntent.java
index 32e5c90..bf3176d 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/TestInstallableIntent.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/TestInstallableIntent.java
@@ -32,7 +32,8 @@
      * @param value intent ID
      */
     public TestInstallableIntent(int value) { // FIXME
-        super(new TestApplicationId("foo"), Collections.emptyList());
+        super(new TestApplicationId("foo"), null, Collections.emptyList(),
+                Intent.DEFAULT_INTENT_PRIORITY);
         this.value = value;
     }
 
diff --git a/core/api/src/test/java/org/onosproject/net/intent/TestIntent.java b/core/api/src/test/java/org/onosproject/net/intent/TestIntent.java
index b3a8679..af3ea49 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/TestIntent.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/TestIntent.java
@@ -32,7 +32,8 @@
      * @param value intent ID
      */
     public TestIntent(int value) { // FIXME
-        super(new TestApplicationId("foo"), Collections.emptyList());
+        super(new TestApplicationId("foo"), null, Collections.emptyList(),
+                Intent.DEFAULT_INTENT_PRIORITY);
         this.value = value;
     }
 
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/IntentCodecTest.java b/core/common/src/test/java/org/onosproject/codec/impl/IntentCodecTest.java
index 57274d8..afd1025 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/IntentCodecTest.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/IntentCodecTest.java
@@ -78,7 +78,11 @@
     @Test
     public void hostToHostIntent() {
         final HostToHostIntent intent =
-                new HostToHostIntent(appId, id1, id2);
+                HostToHostIntent.builder()
+                        .appId(appId)
+                        .one(id1)
+                        .two(id2)
+                        .build();
 
         final JsonCodec<HostToHostIntent> intentCodec =
                 context.codec(HostToHostIntent.class);
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java
index 60306b2..feea42f 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java
@@ -97,9 +97,14 @@
                                     HostToHostIntent intent) {
         TrafficSelector selector = builder(intent.selector())
                 .matchEthSrc(src.mac()).matchEthDst(dst.mac()).build();
-        return new PathIntent(intent.appId(), selector, intent.treatment(),
-                              path, intent.constraints(),
-                              intent.priority());
+        return PathIntent.builder()
+                .appId(intent.appId())
+                .selector(selector)
+                .treatment(intent.treatment())
+                .path(path)
+                .constraints(intent.constraints())
+                .priority(intent.priority())
+                .build();
     }
 
 }
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompiler.java
index 948dbd6..b59d7eb 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompiler.java
@@ -75,11 +75,16 @@
      */
     private Intent createPathIntent(Path path,
                                     MplsIntent intent) {
-        return new MplsPathIntent(intent.appId(),
-                              intent.selector(), intent.treatment(), path,
-                              intent.ingressLabel(), intent.egressLabel(),
-                              intent.constraints(),
-                              intent.priority());
+        return MplsPathIntent.builder()
+                .appId(intent.appId())
+                .selector(intent.selector())
+                .treatment(intent.treatment())
+                .path(path)
+                .ingressLabel(intent.ingressLabel())
+                .egressLabel(intent.egressLabel())
+                .constraints(intent.constraints())
+                .priority(intent.priority())
+                .build();
     }
 
 
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompiler.java
index 6403019..fbdfa9c 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompiler.java
@@ -16,7 +16,6 @@
 package org.onosproject.net.intent.impl.compiler;
 
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -89,14 +88,16 @@
             }
         }
 
-        Set<ConnectPoint> egress = ImmutableSet.of(intent.egressPoint());
-        Intent result = new LinkCollectionIntent(intent.appId(),
-                                                 intent.selector(), intent.treatment(),
-                                                 Sets.newHashSet(links.values()),
-                                                 intent.ingressPoints(),
-                                                 ImmutableSet.of(intent.egressPoint()),
-                                                 Collections.emptyList(),
-                                                 intent.priority());
+        Intent result = LinkCollectionIntent.builder()
+                .appId(intent.appId())
+                .selector(intent.selector())
+                .treatment(intent.treatment())
+                .links(Sets.newHashSet(links.values()))
+                .ingressPoints(intent.ingressPoints())
+                .egressPoints(ImmutableSet.of(intent.egressPoint()))
+                .priority(intent.priority())
+                .build();
+
         return Arrays.asList(result);
     }
 
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
index 0f897a4..208c8e2 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
@@ -91,10 +91,14 @@
      */
     private Intent createPathIntent(Path path,
                                     PointToPointIntent intent) {
-        return new PathIntent(intent.appId(),
-                              intent.selector(), intent.treatment(), path,
-                              intent.constraints(),
-                              intent.priority());
+        return PathIntent.builder()
+                .appId(intent.appId())
+                .selector(intent.selector())
+                .treatment(intent.treatment())
+                .path(path)
+                .constraints(intent.constraints())
+                .priority(intent.priority())
+                .build();
     }
 
 }
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/SinglePointToMultiPointIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/SinglePointToMultiPointIntentCompiler.java
index 4b2260e..8a97b7b 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/SinglePointToMultiPointIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/SinglePointToMultiPointIntentCompiler.java
@@ -16,7 +16,6 @@
 package org.onosproject.net.intent.impl.compiler;
 
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -66,13 +65,16 @@
             links.addAll(path.links());
         }
 
-        Intent result = new LinkCollectionIntent(intent.appId(),
-                                                 intent.selector(),
-                                                 intent.treatment(), links,
-                                                 ImmutableSet.of(intent.ingressPoint()),
-                                                 intent.egressPoints(),
-                                                 Collections.emptyList(),
-                                                 intent.priority());
+        Intent result = LinkCollectionIntent.builder()
+                .appId(intent.appId())
+                .key(intent.key())
+                .selector(intent.selector())
+                .treatment(intent.treatment())
+                .links(links)
+                .ingressPoints(ImmutableSet.of(intent.ingressPoint()))
+                .egressPoints(intent.egressPoints())
+                .priority(intent.priority())
+                .build();
 
         return Arrays.asList(result);
     }
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/IntentManagerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/IntentManagerTest.java
index 5481007..64c963b 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/IntentManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/IntentManagerTest.java
@@ -502,7 +502,8 @@
     public void intentWithoutCompiler() {
         class IntentNoCompiler extends Intent {
             IntentNoCompiler() {
-                super(APPID, Collections.emptyList());
+                super(APPID, null, Collections.emptyList(),
+                        Intent.DEFAULT_INTENT_PRIORITY);
             }
         }
 
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompilerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompilerTest.java
index b154d22..be9ab66 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompilerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompilerTest.java
@@ -90,8 +90,13 @@
      * @return HostToHostIntent for the two hosts
      */
     private HostToHostIntent makeIntent(String oneIdString, String twoIdString) {
-        return new HostToHostIntent(APPID, hid(oneIdString), hid(twoIdString),
-                                    selector, treatment);
+        return HostToHostIntent.builder()
+                .appId(APPID)
+                .one(hid(oneIdString))
+                .two(hid(twoIdString))
+                .selector(selector)
+                .treatment(treatment)
+                .build();
     }
 
     /**
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompilerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompilerTest.java
index 4890e03..76b26f4 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompilerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompilerTest.java
@@ -55,11 +55,14 @@
     private MplsIntent makeIntent(String ingressIdString,  Optional<MplsLabel> ingressLabel,
                                           String egressIdString, Optional<MplsLabel> egressLabel) {
 
-        return new MplsIntent(APPID, selector, treatment,
-                                      connectPoint(ingressIdString, 1),
-                                      ingressLabel,
-                                      connectPoint(egressIdString, 1),
-                                      egressLabel);
+        return MplsIntent.builder()
+                .appId(APPID)
+                .selector(selector)
+                .treatment(treatment)
+                .ingressPoint(connectPoint(ingressIdString, 1))
+                .ingressLabel(ingressLabel)
+                .egressPoint(connectPoint(egressIdString, 1))
+                .egressLabel(egressLabel).build();
     }
     /**
      * Creates a compiler for HostToHost intents.
@@ -157,7 +160,15 @@
     public void testSameSwitchDifferentPortsIntentCompilation() {
         ConnectPoint src = new ConnectPoint(deviceId("1"), portNumber(1));
         ConnectPoint dst = new ConnectPoint(deviceId("1"), portNumber(2));
-        MplsIntent intent = new MplsIntent(APP_ID, selector, treatment, src, Optional.empty(), dst, Optional.empty());
+        MplsIntent intent = MplsIntent.builder()
+                .appId(APP_ID)
+                .selector(selector)
+                .treatment(treatment)
+                .ingressPoint(src)
+                .ingressLabel(Optional.empty())
+                .egressPoint(dst)
+                .egressLabel(Optional.empty())
+                .build();
 
         String[] hops = {"1"};
         MplsIntentCompiler sut = makeCompiler(hops);
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompilerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompilerTest.java
index bbc7ad1..eb6be57 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompilerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MultiPointToSinglePointIntentCompilerTest.java
@@ -104,8 +104,13 @@
             ingressPoints.add(connectPoint(ingressId, 1));
         }
 
-        return new MultiPointToSinglePointIntent(APPID, selector, treatment,
-                                                 ingressPoints, egressPoint);
+        return MultiPointToSinglePointIntent.builder()
+                .appId(APPID)
+                .selector(selector)
+                .treatment(treatment)
+                .ingressPoints(ingressPoints)
+                .egressPoint(egressPoint)
+                .build();
     }
 
     /**
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/installer/LinkCollectionIntentInstallerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/installer/LinkCollectionIntentInstallerTest.java
index 9f88fa6..00ebedf 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/installer/LinkCollectionIntentInstallerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/installer/LinkCollectionIntentInstallerTest.java
@@ -56,7 +56,14 @@
         installer.coreService = testCoreService;
         installer.intentManager =
                 new IntentInstallerTest.MockIntentManager(LinkCollectionIntent.class);
-        intent = new LinkCollectionIntent(APP_ID, selector, treatment, links, d1p1, d3p1);
+        intent = LinkCollectionIntent.builder()
+                .appId(APP_ID)
+                .selector(selector)
+                .treatment(treatment)
+                .links(links)
+                .ingressPoints(ImmutableSet.of(d1p1))
+                .egressPoints(ImmutableSet.of(d3p1))
+                .build();
     }
 
     private FlowRuleOperation findOperation(Collection<FlowRuleOperation> ops,
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/installer/MplsPathIntentInstallerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/installer/MplsPathIntentInstallerTest.java
index 8001eed..e88947c 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/installer/MplsPathIntentInstallerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/installer/MplsPathIntentInstallerTest.java
@@ -31,8 +31,6 @@
 import org.onosproject.net.intent.MplsPathIntent;
 import org.onosproject.store.trivial.impl.SimpleLinkStore;
 
-import com.google.common.collect.ImmutableList;
-
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.Matchers.notNullValue;
@@ -70,12 +68,15 @@
         installer.linkStore = new SimpleLinkStore();
         installer.resourceService = new IntentTestsMocks.MockResourceService();
 
-        intent = new MplsPathIntent(APP_ID, selector, treatment,
-                new DefaultPath(PID, links, hops),
-                ingressLabel,
-                egressLabel,
-                ImmutableList.of(),
-                55);
+        intent = MplsPathIntent.builder()
+                .appId(APP_ID)
+                .selector(selector)
+                .treatment(treatment)
+                .path(new DefaultPath(PID, links, hops))
+                .ingressLabel(ingressLabel)
+                .egressLabel(egressLabel)
+                .priority(55)
+                .build();
     }
 
     /**
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/installer/PathConstraintCalculationTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/installer/PathConstraintCalculationTest.java
index d0bb843..6e7606d 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/installer/PathConstraintCalculationTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/installer/PathConstraintCalculationTest.java
@@ -73,8 +73,14 @@
 
     private PathIntent createPathIntent(List<Link> links, List<Constraint> constraints) {
         int hops = links.size() - 1;
-        return new PathIntent(APP_ID, selector, treatment,
-                              new DefaultPath(PID, links, hops), constraints, 333);
+        return PathIntent.builder()
+                .appId(APP_ID)
+                .selector(selector)
+                .treatment(treatment)
+                .path(new DefaultPath(PID, links, hops))
+                .constraints(constraints)
+                .priority(333)
+                .build();
     }
 
     /**
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/installer/PathIntentInstallerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/installer/PathIntentInstallerTest.java
index 695f115..9bbd16c 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/installer/PathIntentInstallerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/installer/PathIntentInstallerTest.java
@@ -27,8 +27,6 @@
 import org.onosproject.net.flow.FlowRuleOperation;
 import org.onosproject.net.intent.PathIntent;
 
-import com.google.common.collect.ImmutableList;
-
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.Matchers.notNullValue;
@@ -61,9 +59,13 @@
         installer = new PathIntentInstaller();
         installer.coreService = testCoreService;
         installer.intentManager = new MockIntentManager(PathIntent.class);
-        intent = new PathIntent(APP_ID, selector, treatment,
-                new DefaultPath(PID, links, hops), ImmutableList.of(),
-                77);
+        intent = PathIntent.builder()
+                .appId(APP_ID)
+                .selector(selector)
+                .treatment(treatment)
+                .path(new DefaultPath(PID, links, hops))
+                .priority(77)
+                .build();
     }
 
     /**
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java
index d450812..a968e4e 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java
@@ -97,7 +97,12 @@
                 .ingressPoint(cp1)
                 .egressPoint(cp3)
                 .build();
-        compiled = new PathIntent(appId, selector, treatment, path);
+        compiled = PathIntent.builder()
+                .appId(appId)
+                .selector(selector)
+                .treatment(treatment)
+                .path(path)
+                .build();
     }
 
 
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallCoordinatingTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallCoordinatingTest.java
index 678bd2d..1938425 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallCoordinatingTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallCoordinatingTest.java
@@ -98,7 +98,12 @@
                 .ingressPoint(cp1)
                 .egressPoint(cp3)
                 .build();
-        compiled = new PathIntent(appId, selector, treatment, path);
+        compiled = PathIntent.builder()
+                .appId(appId)
+                .selector(selector)
+                .treatment(treatment)
+                .path(path)
+                .build();
     }
 
 
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallingTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallingTest.java
index b7d063f..8d4b334 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallingTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallingTest.java
@@ -98,7 +98,12 @@
                 .ingressPoint(cp1)
                 .egressPoint(cp3)
                 .build();
-        compiled = new PathIntent(appId, selector, treatment, path);
+        compiled = PathIntent.builder()
+                .appId(appId)
+                .selector(selector)
+                .treatment(treatment)
+                .path(path)
+                .build();
     }
 
 
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawCoordinatingTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawCoordinatingTest.java
index 19c3f6f..5d40516 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawCoordinatingTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawCoordinatingTest.java
@@ -99,7 +99,12 @@
                 .ingressPoint(cp1)
                 .egressPoint(cp3)
                 .build();
-        compiled = new PathIntent(appId, selector, treatment, path);
+        compiled = PathIntent.builder()
+                .appId(appId)
+                .selector(selector)
+                .treatment(treatment)
+                .path(path)
+                .build();
     }
 
 
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawingTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawingTest.java
index a1f08ec..6f7f267 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawingTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawingTest.java
@@ -97,7 +97,12 @@
                 .ingressPoint(cp1)
                 .egressPoint(cp3)
                 .build();
-        compiled = new PathIntent(appId, selector, treatment, path);
+        compiled = PathIntent.builder()
+                .appId(appId)
+                .selector(selector)
+                .treatment(treatment)
+                .path(path)
+                .build();
     }
 
 
