/**

   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;

public class AttributeDefinition {
    private String id;
    private String name;
    private String description;
    private boolean required;

    /**
     * Returns the attribute identifier.
     */
    public String getId() {
        return id;
    }

    /**
     * Returns a localizabled name.
     */
    public String getName() {
        return name;
    }

    /**
     * Returns a localizabled description.
     */
    public String getDescription() {
        return description;
    }

    public boolean isRequired() {
        return required;
    }

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

    public static class Builder {
        private final AttributeDefinition a;

        public Builder() {
            a = new AttributeDefinition();
        }

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

        public Builder name(String name) {
            a.name = name;
            return this;
        }

        public Builder description(String description) {
            a.description = description;
            return this;
        }

        public Builder required() {
            a.required = true;
            return this;
        }

        public AttributeDefinition build() {
            return a;
        }
    }
}

@@ -1388,18 +1388,26 @@
 nition a
+ttribute
 ;%0A
-
 %0A       
@@ -1439,16 +1439,24 @@
        a
+ttribute
  = new A
@@ -1540,16 +1540,24 @@
        a
+ttribute
 .id = id
@@ -1650,16 +1650,24 @@
        a
+ttribute
 .name = 
@@ -1778,16 +1778,24 @@
        a
+ttribute
 .descrip
@@ -1899,16 +1899,24 @@
        a
+ttribute
 .require
@@ -2002,24 +2002,24 @@
 n build() %7B%0A
-
             
@@ -2026,16 +2026,24 @@
 return a
+ttribute
 ;%0A      

use more descriptive field names