/**
 * This file is part of Everit - Component Metadata.
 *
 * Everit - Component Metadata is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Everit - Component Metadata is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Everit - Component Metadata.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.everit.osgi.ecm.metadata;


public class ServiceMetadata {

    public static class ServiceMetadataBuilder {
        private Class<?>[] clazzes;

        public ServiceMetadata build() {
            return new ServiceMetadata(clazzes);
        }

        public ServiceMetadataBuilder withClazzes(final Class<?>[] clazzes) {
            if (clazzes == null) {
                this.clazzes = null;
            } else {
                this.clazzes = clazzes.clone();
            }
            return this;
        }

    }

    private final Class<?>[] clazzes;

    private ServiceMetadata(final Class<?>[] clazzes) {
        this.clazzes = clazzes;
    }

    public Class<?>[] getClazzes() {
        if (clazzes != null) {
            return clazzes.clone();
        } else {
            return null;
        }
    }
}

@@ -808,17 +808,16 @@
 adata;%0A%0A
-%0A
 public c
@@ -919,24 +919,42 @@
 ?%3E%5B%5D clazzes
+ = new Class%3C?%3E%5B0%5D
 ;%0A%0A        p
@@ -1180,52 +1180,158 @@
   th
-is.clazzes = null;%0A            %7D else %7B%0A    
+row new MetadataValidationException(%0A                        %22Null cannot be provided as service interface array for ServiceMetadata%22);%0A            %7D%0A
     
@@ -1370,29 +1370,16 @@
 lone();%0A
-            %7D
 %0A       

Throw exception if null is provided as service interfaces array.