//:: # Copyright 2013, Big Switch Networks, Inc.
//:: #
//:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
//:: # the following special exception:
//:: #
//:: # LOXI Exception
//:: #
//:: # As a special exception to the terms of the EPL, you may distribute libraries
//:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
//:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
//:: # from the LoxiGen Libraries and the notice provided below is (i) included in
//:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
//:: # documentation for the LoxiGen Libraries, if distributed in binary form.
//:: #
//:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
//:: #
//:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
//:: # a copy of the EPL at:
//:: #
//:: # http::: #www.eclipse.org/legal/epl-v10.html
//:: #
//:: # 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
//:: # EPL for the specific language governing permissions and limitations
//:: # under the EPL.
//::
//:: import itertools
//:: import of_g
//:: include('_copyright.java')

//:: include('_autogen.java')

package ${package};

//:: include("_imports.java", msg=enum)

public enum ${class_name} {

//:: for i, entry in enumerate(enum.entries):
//::    if enum.metadata.properties:
//::        params = "({})".format(", ".join(entry.constructor_params))
//::    else:
//::        params = ""
//::    #endif
//::    delimiter = ", " if i < len(enum.entries)-1 else ";"
//::    to_string_value = enum.metadata.to_string(entry) if enum.metadata.to_string else None
//::    if to_string_value:
     ${entry.name}${params} {
         @Override
         public String toString() {
            return "${to_string_value}";
         }
     }${delimiter}
//::    else:
     ${entry.name}${params}${delimiter}
//::    #endif
//:: #endfor
//:: if enum.metadata.properties:

//:: for property_metadata in enum.metadata.properties:
     private final ${property_metadata.type.public_type} ${property_metadata.variable_name};
//:: #endfor

     private ${class_name}(${", ".join("{} {}".format(m.type.public_type, m.variable_name) for m in enum.metadata.properties)}) {
     //:: for property_metadata in enum.metadata.properties:
        this.${property_metadata.variable_name} = ${property_metadata.variable_name};
     //:: #endfor
     }
//:: for property_metadata in enum.metadata.properties:

     public ${property_metadata.type.public_type} ${property_metadata.getter_name}() {
         return ${property_metadata.variable_name};
     }
//:: #endfor
//:: #endif
}
