com.bitmechanic.barrister.Enum Maven / Gradle / Ivy
package com.bitmechanic.barrister;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.Map;
import java.util.List;
/**
* Represents an 'enum' in the IDL
*/
public class Enum extends BaseEntity {
private Set values;
/**
* Creates an enum with the given name and values
*
* @param name Name of enum from IDL
* @param vals Valid values for enum from IDL
*/
public Enum(String name, String... vals) {
this.name = name;
this.values = new LinkedHashSet();
for (String v : vals) {
values.add(v);
}
}
/**
* Creates an enum from IDL Map representation, parsing the 'name', 'comment', and 'values'
*/
@SuppressWarnings("unchecked")
public Enum(Map data) {
super(data);
values = new LinkedHashSet();
List © 2015 - 2025 Weber Informatics LLC | Privacy Policy