/** * Adds the specified constant to this enum. The constant must not be null. * * @param constant the constant * @return a reference to this model */ default Enum add(EnumConstant constant) { getConstants().add(requireNonNull(constant)); return this; }
@Override protected String onBeforeFields(Generator gen, Enum model) { requireNonNulls(gen, model); final List<String> constants = model.getConstants().stream() .map(c -> gen.on(c).get()).collect(toList()); Formatting.alignTabs(constants); return constants.stream().collect( joinIfNotEmpty( (!model.getConstants().isEmpty() && (!model.getConstants().get(0).getValues().isEmpty() || !model.getConstants().get(0).getAnnotations().isEmpty())) ? "," + nl() : ", ", "", ";" ) ); }
/** * Copy constructor. * * @param prototype the prototype */ protected EnumImpl(Enum prototype) { super (prototype); constants = Copier.copy(prototype.getConstants()); constructors = Copier.copy(prototype.getConstructors()); }
((Enum) model).getConstants() .forEach(ec -> findTypesIn(ec, types));
/** * Adds the specified constant to this enum. The constant must not be null. * * @param constant the constant * @return a reference to this model */ default Enum add(EnumConstant constant) { getConstants().add(requireNonNull(constant)); return this; }
/** * Adds the specified constant to this enum. The constant must not be null. * * @param constant the constant * @return a reference to this model */ default Enum add(EnumConstant constant) { getConstants().add(requireNonNull(constant)); return this; }
@Override protected String onBeforeFields(Generator gen, Enum model) { requireNonNulls(gen, model); final List<String> constants = model.getConstants().stream() .map(c -> gen.on(c).get()).collect(toList()); Formatting.alignTabs(constants); return constants.stream().collect( joinIfNotEmpty( (!model.getConstants().isEmpty() && (!model.getConstants().get(0).getValues().isEmpty() || !model.getConstants().get(0).getAnnotations().isEmpty())) ? "," + nl() : ", ", "", ";" ) ); }
@Override protected String onBeforeFields(Generator gen, Enum model) { requireNonNulls(gen, model); final List<String> constants = model.getConstants().stream() .map(c -> gen.on(c).get()).collect(toList()); Formatting.alignTabs(constants); return constants.stream().collect( joinIfNotEmpty( (!model.getConstants().isEmpty() && !model.getConstants().get(0).getValues().isEmpty()) ? "," + nl() : ", ", "", ";" ) ); }
/** * Copy constructor. * * @param prototype the prototype */ protected EnumImpl(Enum prototype) { super (prototype); constants = Copier.copy(prototype.getConstants()); constructors = Copier.copy(prototype.getConstructors()); }
/** * Copy constructor. * * @param prototype the prototype */ protected EnumImpl(Enum prototype) { super (prototype); constants = Copier.copy(prototype.getConstants()); constructors = Copier.copy(prototype.getConstructors()); }
((Enum) model).getConstants() .forEach(ec -> findTypesIn(ec, types));