/**

   Copyright 2010 OpenEngSB Division, Vienna University of Technology

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

 */
package org.openengsb.core.config.descriptor;

import java.util.ArrayList;
import java.util.List;

public class ServiceDescriptor {
    private String id;
    private String serviceInterface;
    private final List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();

    public ServiceDescriptor() {
    }

    /**
     * Returns an id that uniquely identifies this managed service.
     */
    public String getId() {
        return id;
    }

    /**
     * Returns the service interface id this service implements.
     */
    public String getServiceInterfaceId() {
        return serviceInterface;
    }

    /**
     * Returns a list of attributes the described service supports.
     */
    public List<AttributeDefinition> getAttributes() {
        return attributes;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private final ServiceDescriptor desc;

        public Builder() {
            desc = new ServiceDescriptor();
        }

        public Builder id(String id) {
            desc.id = id;
            return this;
        }

        public Builder implementsInterface(String serviceInterface) {
            desc.serviceInterface = serviceInterface;
            return this;
        }

        public Builder attribute(AttributeDefinition ad) {
            desc.attributes.add(ad);
            return this;
        }

        public ServiceDescriptor build() {
            return desc;
        }
    }
}

@@ -813,24 +813,81 @@
 eInterface;%0A
+    private String name;%0A    private String description;%0A
     private 
@@ -969,16 +969,16 @@
 ion%3E();%0A
-
 %0A    pub
@@ -1305,32 +1305,267 @@
 terface;%0A    %7D%0A%0A
+    /**%0A     * Returns a localized name.%0A     */%0A    public String getName() %7B%0A        return name;%0A    %7D%0A%0A    /**%0A     * Returns a localized description.%0A     */%0A    public String getDescription() %7B%0A        return description;%0A    %7D%0A%0A
     /**%0A     * R
@@ -2126,24 +2126,24 @@
 nterface) %7B%0A
-
             
@@ -2212,32 +2212,278 @@
 his;%0A        %7D%0A%0A
+        public Builder name(String name) %7B%0A            desc.name = name;%0A            return this;%0A        %7D%0A%0A        public Builder description(String description) %7B%0A            desc.description = description;%0A            return this;%0A        %7D%0A%0A
         public B

add name and description field to service descriptor