--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * VID\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+package org.openecomp.vid.model;\r
+\r
+/**\r
+ * The Class ModelUtil.\r
+ *\r
+ */\r
+public class ModelUtil {\r
+ /**\r
+ * Gets the tags for the given element according to the configured namespace\r
+ * @param namespaces the namespace list from the configuration\r
+ * @param constantValue the constant portion of the tag name, i.e. resource.vf...\r
+ * @return the tags\r
+ */\r
+ public static String[] getTags ( String[] namespaces, String constantValue ) {\r
+ String[] tags;\r
+ if ( namespaces == null || namespaces.length == 0 ) {\r
+ return null;\r
+ }\r
+ int le = namespaces.length;\r
+ tags = new String[le];\r
+ for ( int i = 0; i < le; i++ ) {\r
+ tags[i] = namespaces[i] + constantValue;\r
+ }\r
+ return (tags);\r
+ }\r
+ /**\r
+ * Determine if a note template type matches a set of configurable tags\r
+ * @param type the node template type\r
+ * @param tags the model configurable namespaces\r
+ * @return true if type starts with a tag in the array, false otherwise\r
+ */\r
+ public static boolean isType ( String type, String[] tags ) {\r
+ if ( (tags != null) && (tags.length > 0) ) {\r
+ for ( int i = 0; i < tags.length; i++ ) {\r
+ if ( type.startsWith (tags[i]) ) {\r
+ return (true);\r
+ }\r
+ }\r
+ }\r
+ return (false);\r
+ }\r
+}\r