/** * Constructor for the Node objects, it validate the input so if * the ID passed is not of the type expected accordingly to the * type an exception is raised. * * @param nodeType Type of the node we are building * @param id ID used by the SDN technology to identify the node * */ public Node(String nodeType, Object id) throws ConstructionException { if (NodeIDType.getClassType(nodeType) != null && NodeIDType.getClassType(nodeType).isInstance(id)) { this.nodeType = nodeType; this.nodeID = id; } else { throw new ConstructionException("Type of incoming object:" + id.getClass() + " not compatible with expected type:" + NodeIDType.getClassType(nodeType)); } }