/*
 * digitalpetri OPC-UA SDK
 *
 * Copyright (C) 2015 Kevin Herron
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.digitalpetri.opcua.sdk.core;

import com.digitalpetri.opcua.stack.core.types.builtin.unsigned.UInteger;

import static com.digitalpetri.opcua.stack.core.types.builtin.unsigned.Unsigned.uint;

public enum AttributeId {

    NODE_ID(1),
    NODE_CLASS(2),
    BROWSE_NAME(3),
    DISPLAY_NAME(4),
    DESCRIPTION(5),
    WRITE_MASK(6),
    USER_WRITE_MASK(7),
    IS_ABSTRACT(8),
    SYMMETRIC(9),
    INVERSE_NAME(10),
    CONTAINS_NO_LOOPS(11),
    EVENT_NOTIFIER(12),
    VALUE(13),
    DATA_TYPE(14),
    VALUE_RANK(15),
    ARRAY_DIMENSIONS(16),
    ACCESS_LEVEL(17),
    USER_ACCESS_LEVEL(18),
    MINIMUM_SAMPLING_INTERVAL(19),
    HISTORIZING(20),
    EXECUTABLE(21),
    USER_EXECUTABLE(22);

    private final int id;

    AttributeId(int id) {
        this.id = id;
    }

    public final int id() {
        return id;
    }

    public final UInteger uid() {
        return uint(id);
    }

}

@@ -778,16 +778,43 @@
 .core;%0A%0A
+import java.util.EnumSet;%0A%0A
 import c
@@ -878,16 +878,102 @@
 Integer;
+%0Aimport com.google.common.collect.ImmutableSet;%0Aimport com.google.common.collect.Sets;
 %0A%0Aimport
@@ -1531,24 +1531,24 @@
 UTABLE(21),%0A
-
     USER_EXE
@@ -1561,16 +1561,2245 @@
 E(22);%0A%0A
+    public static final ImmutableSet%3CAttributeId%3E BASE_NODE_ATTRIBUTES = ImmutableSet.copyOf(%0A            EnumSet.of(%0A                    NODE_ID, NODE_CLASS, BROWSE_NAME, DISPLAY_NAME, DESCRIPTION, WRITE_MASK, USER_WRITE_MASK)%0A    );%0A%0A    public static final ImmutableSet%3CAttributeId%3E DATA_TYPE_NODE_ATTRIBUTES = ImmutableSet.copyOf(%0A            Sets.union(%0A                    BASE_NODE_ATTRIBUTES,%0A                    EnumSet.of(IS_ABSTRACT))%0A    );%0A%0A    public static final ImmutableSet%3CAttributeId%3E METHOD_NODE_ATTRIBUTES = ImmutableSet.copyOf(%0A            Sets.union(%0A                    BASE_NODE_ATTRIBUTES,%0A                    EnumSet.of(EXECUTABLE, USER_EXECUTABLE))%0A    );%0A%0A    public static final ImmutableSet%3CAttributeId%3E OBJECT_NODE_ATTRIBUTES = ImmutableSet.copyOf(%0A            Sets.union(%0A                    BASE_NODE_ATTRIBUTES,%0A                    EnumSet.of(EVENT_NOTIFIER))%0A    );%0A%0A    public static final ImmutableSet%3CAttributeId%3E OBJECT_TYPE_NODE_ATTRIBUTES = ImmutableSet.copyOf(%0A            Sets.union(%0A                    BASE_NODE_ATTRIBUTES,%0A                    EnumSet.of(IS_ABSTRACT))%0A    );%0A%0A    public static final ImmutableSet%3CAttributeId%3E REFERENCE_TYPE_NODE_ATTRIBUTES = ImmutableSet.copyOf(%0A            Sets.union(%0A                    BASE_NODE_ATTRIBUTES,%0A                    EnumSet.of(IS_ABSTRACT, SYMMETRIC, INVERSE_NAME))%0A    );%0A%0A    public static final ImmutableSet%3CAttributeId%3E VARIABLE_NODE_ATTRIBUTES = ImmutableSet.copyOf(%0A            Sets.union(%0A                    BASE_NODE_ATTRIBUTES,%0A                    EnumSet.of(VALUE, DATA_TYPE, VALUE_RANK, ARRAY_DIMENSIONS,%0A                            ACCESS_LEVEL, USER_ACCESS_LEVEL, MINIMUM_SAMPLING_INTERVAL, HISTORIZING))%0A    );%0A%0A    public static final ImmutableSet%3CAttributeId%3E VARIABLE_TYPE_NODE_ATTRIBUTES = ImmutableSet.copyOf(%0A            Sets.union(%0A                    BASE_NODE_ATTRIBUTES,%0A                    EnumSet.of(VALUE, DATA_TYPE, VALUE_RANK, ARRAY_DIMENSIONS, IS_ABSTRACT))%0A    );%0A%0A    public static final ImmutableSet%3CAttributeId%3E VIEW_NODE_ATTRIBUTES = ImmutableSet.copyOf(%0A            Sets.union(%0A                    BASE_NODE_ATTRIBUTES,%0A                    EnumSet.of(CONTAINS_NO_LOOPS, EVENT_NOTIFIER))%0A    );%0A%0A
     priv

Add attribute sets for each NodeClass to AttributeId