use of org.onosproject.net.intent.constraint.ObstacleConstraint in project onos by opennetworkinglab.
the class EncodeConstraintCodecHelper method encode.
/**
* Encodes the constraint in JSON.
*
* @return JSON node
*/
public ObjectNode encode() {
final ObjectNode result;
if (constraint instanceof BandwidthConstraint) {
result = encodeBandwidthConstraint();
} else if (constraint instanceof LinkTypeConstraint) {
result = encodeLinkTypeConstraint();
} else if (constraint instanceof AnnotationConstraint) {
result = encodeAnnotationConstraint();
} else if (constraint instanceof LatencyConstraint) {
result = encodeLatencyConstraint();
} else if (constraint instanceof ObstacleConstraint) {
result = encodeObstacleConstraint();
} else if (constraint instanceof WaypointConstraint) {
result = encodeWaypointConstraint();
} else if (constraint instanceof MeteredConstraint) {
result = encodeMeteredConstraint();
} else if (constraint instanceof TierConstraint) {
result = encodeTierConstraint();
} else {
result = context.mapper().createObjectNode();
}
result.put(ConstraintCodec.TYPE, constraint.getClass().getSimpleName());
return result;
}
Aggregations