package jetbrains.mps.lang.generator.structure; /*Generated by MPS */ import jetbrains.mps.smodel.PropertySupport; import java.util.Iterator; import jetbrains.mps.internal.collections.runtime.ListSequence; public class GeneratorMessageType_PropertySupport extends PropertySupport { public boolean canSetValue(String value) { if (value == null) { return true; } Iterator<GeneratorMessageType> constants = ListSequence.fromList(GeneratorMessageType.getConstants()).iterator(); while (constants.hasNext()) { GeneratorMessageType constant = constants.next(); if (value.equals(constant.getName())) { return true; } } return false; } public String toInternalValue(String value) { if (value == null) { return null; } Iterator<GeneratorMessageType> constants = ListSequence.fromList(GeneratorMessageType.getConstants()).iterator(); while (constants.hasNext()) { GeneratorMessageType constant = constants.next(); if (value.equals(constant.getName())) { return constant.getValueAsString(); } } return null; } public String fromInternalValue(String value) { GeneratorMessageType constant = GeneratorMessageType.parseValue(value); if (constant != null) { return constant.getName(); } return ""; } }