Custom attribute writer method checking allowed values (enum).
 @param [Object] eac3_drc_line_mode_profile Object to be assigned
979169
def eac3_drc_line_mode_profile=(eac3_drc_line_mode_profile)
      validator = EnumAttributeValidator.new('String', ["p0", "p1", "p2", "p3", "p4", "p5"])
      unless validator.valid?(eac3_drc_line_mode_profile)
        fail ArgumentError, "invalid value for 'eac3_drc_line_mode_profile', must be one of #{validator.allowable_values}."
      end
      @eac3_drc_line_mode_profile = eac3_drc_line_mode_profile
    end
827514
def _checkAttribs(self, strict):
        """"""
        if self.min:
            warning("Minimum value not allowed for boolean-type parameter " +
                    self.name, strict)
            self.min = None
        if self.max:
            if not self.prompt:
                warning("Maximum value not allowed for boolean-type parameter " +
                                self.name + " (probably missing comma)",
                                strict)
                # try to recover by assuming max string is prompt
                self.prompt = self.max
            else:
                warning("Maximum value not allowed for boolean-type parameter " +
                        self.name, strict)
            self.max = None
        if self.choice:
            warning("Choice values not allowed for boolean-type parameter " +
                    self.name, strict)
            self.choice = None
906440
def action=(action)
      validator = EnumAttributeValidator.new('String', ["COMPLETE", "CANCEL", "REFUND"])
      unless validator.valid?(action)
        fail ArgumentError, "invalid value for 'action', must be one of #{validator.allowable_values}."
      end
      @action = action
    end
712484
def strict=(strict)
      validator = EnumAttributeValidator.new('String', ["none"])
      unless validator.valid?(strict)
        fail ArgumentError, "invalid value for 'strict', must be one of #{validator.allowable_values}."
      end
      @strict = strict
    end
790389
def visibility=(visibility)
      validator = EnumAttributeValidator.new('String', ["PUBLIC", "PRIVATE"])
      unless validator.valid?(visibility)
        fail ArgumentError, "invalid value for 'visibility', must be one of #{validator.allowable_values}."
      end
      @visibility = visibility
    end
1365215
private static boolean validateEnumeration(
            Collection<String> allowedValues, String value) {
        return (allowedValues != null && allowedValues.contains(value));
    }
853573
def document_type=(document_type)
      validator = EnumAttributeValidator.new('String', ["pdf", "xls", "xlsx"])
      unless validator.valid?(document_type)
        fail ArgumentError, "invalid value for 'document_type', must be one of #{validator.allowable_values}."
      end
      @document_type = document_type
    end
43468
def eac3_room_type=(eac3_room_type)
      validator = EnumAttributeValidator.new('String', ["m0", "m1", "m2"])
      unless validator.valid?(eac3_room_type)
        fail ArgumentError, "invalid value for 'eac3_room_type', must be one of #{validator.allowable_values}."
      end
      @eac3_room_type = eac3_room_type
    end
906607
private void updateEnumOptions(EntityType entityType, Attribute attr, Attribute updatedAttr) {
    if (attr.getDataType() == ENUM) {
      if (updatedAttr.getDataType() == ENUM) {
        // update check constraint
        dropCheckConstraint(entityType, attr);
        createCheckConstraint(entityType, updatedAttr);
      } else {
        // drop check constraint
        dropCheckConstraint(entityType, attr);
      }
    } else {
      if (updatedAttr.getDataType() == ENUM) {
        createCheckConstraint(entityType, updatedAttr);
      }
    }
  }
662444
def validate(cls, value):
        
        if value not in cls._valid_settings:
            raise ValueError(
                "%s not a member of %s enumeration" % (value, cls.__name__)
            )
934434
def valid_input?(input)
      case @attributes[:type]
      when :boolean
        [true,false].include?(input)
      when :enum
        raise MissingValuesError unless @attributes[:values]
        raise InvalidValuesError unless @attributes[:values].class == Array
        @attributes[:values].include?(input)
      when :string
        format = @attributes[:format] || :anything
        Validator.valid_input?(format, input)
      when :number
        [Integer, Fixnum].include?(input.class)
      when :timestamp
        # TODO timestamp pending
        # raise PendingBranchError
        true
      else
        false
      end
    end
710720
def valid?
      order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
      return false unless order_validator.valid?(@order)
      status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "INACTIVE"])
      return false unless status_validator.valid?(@status)
      return true
    end
12924
def h264_profile=(h264_profile)
      validator = EnumAttributeValidator.new('String', ["baseline", "main", "high", "high10", "high422", "high444"])
      unless validator.valid?(h264_profile)
        fail ArgumentError, "invalid value for 'h264_profile', must be one of #{validator.allowable_values}."
      end
      @h264_profile = h264_profile
    end
744067
def code_text_alignment=(code_text_alignment)
      validator = EnumAttributeValidator.new('String', ["None", "Above", "Below", "Right"])
      if code_text_alignment.to_i == 0
        unless validator.valid?(code_text_alignment)
          raise ArgumentError, "invalid value for 'code_text_alignment', must be one of #{validator.allowable_values}."
        end
        @code_text_alignment = code_text_alignment
      else
        @code_text_alignment = validator.allowable_values[code_text_alignment.to_i]
      end
    end
884558
public <T extends Enum<T>> T  validateEnum(Config config, String value, Class<T> type, T... choices) {
    if (choices.length == 0) {
      choices = type.getEnumConstants();
    }
    Preconditions.checkArgument(choices.length > 0);
    try {
      T result = Enum.valueOf(type, value);
      if (!Arrays.asList(choices).contains(result)) {
        throw new IllegalArgumentException();
      }
      return result;
    } catch (IllegalArgumentException e) {
      throw new MorphlineCompilationException(
        String.format("Invalid choice: '%s' (choose from {%s})", 
                      value, 
                      Joiner.on(",").join(choices)), 
        config);
    }
  }
702830
def sort_field=(sort_field)
      validator = EnumAttributeValidator.new('String', ["DEFAULT", "CREATED_AT"])
      unless validator.valid?(sort_field)
        fail ArgumentError, "invalid value for 'sort_field', must be one of #{validator.allowable_values}."
      end
      @sort_field = sort_field
    end
24128
def label(rec, attr, enum = nil)
      if !enum
        enum = rec.class.const_get(attr.to_s.camelize)
        raise(NameError, "wrong constant name #{attr}") if !enum
      end
      if !@enum_map[enum]
        @enum_map[enum] = {}
      end
      value = rec.attributes[attr.to_s]
      if label = @enum_map[enum][value]
        @hit += 1
        label
      else
        member = enum.constants.detect{|m|
                    enum.const_get(m) == value
                 }
        @enum_map[enum][value] = 
            if member
              @out += 1
              rec.class.human_const_name(enum, member)
            else
              @out_of_enum += 1
              '??'
            end
      end
    end