Package com.sogou.qadev.service.cynthia.bean

Examples of com.sogou.qadev.service.cynthia.bean.Option


            if(field.getDataType().equals(DataType.dt_single))
            {
              UUID optionId = task.getSingleSelection(field.getId());
              if(optionId != null)
              {
                Option option = field.getOption(optionId);
                if(option != null)
                  fieldShowValue =  option.getName();
              }
            }
            else
            {
              UUID[] optionIdArray = task.getMultiSelection(field.getId());
              if(optionIdArray != null && optionIdArray.length > 0)
              {
                StringBuffer valueStrb = new StringBuffer();
                for(UUID optionId : optionIdArray)
                {
                  Option option = field.getOption(optionId);
                  if(option != null)
                  {
                    if(valueStrb.length() > 0)
                      valueStrb.append(",");
                   
                    valueStrb.append("[").append(option.getName()).append("]");
                  }
                }
               
                if(valueStrb.length() > 0)
                  fieldShowValue =  valueStrb.toString();
View Full Code Here


         
          UUID controlOptionId = data.getSingleSelection(controlFieldId);
         
          UUID curOptionId = data.getSingleSelection(field.getId());
         
          Option curOption = field.getOption(curOptionId);
         
          if (curOption == null || !curOption.getControlOptionId().getValue().equals(controlOptionId.getValue())) {
            Field controlField = template.getField(controlFieldId);
            return controlField.getName() + "选项下没有" + field.getName() + "值!";
          }
        }
      }
View Full Code Here

                        data.setDate(field.getId(), timeDate);
                        extValueMap.put(field.getId(), new Pair<Object, Object>(null, timeDate));
                      }
                    }
                  }else if (field.getType()==Type.t_selection) {  //处理单选类型
                    Option option = field.getOption(cellContentString);
                    if (option == null) {
                      if (allNeedFields.contains(field)) {  //为空必填
                        //错误,单选选项错误
                        isSingleFail = true;
                        errorInfo = new ErrorInfo() ;
                        errorInfo.setErrorDescription("单选选项错误");
                        errorInfo.setErrorRowNum(j);
                        errorInfo.setErrorColumnName(field.getName());
                        break;
                      }
                    }else {
                      data.setSingleSelection(field.getId(), option.getId());
                      extValueMap.put(field.getId(), new Pair<Object, Object>(null,option.getId()));
                    }
                  }else //普通字段类型
                    data.setString(field.getId(), cellContentString);
                    extValueMap.put(field.getId(), new Pair<Object, Object>(null, cellContentString));
                  }
View Full Code Here

    for (Field field : template.getFields()) {
      if (field.getType().equals(Type.t_selection)) {
        if (field.getDataType().equals(DataType.dt_single)) {
          UUID optionId = task.getSingleSelection(field.getId());
          if (optionId != null) {
            Option option = field.getOption(optionId);
            if (option != null)
              dataMap.put(field.getName(), option.getName());
          }
        } else {
          UUID[] optionIdArray = task
              .getMultiSelection(field.getId());
          if (optionIdArray != null && optionIdArray.length > 0) {
            StringBuffer valueStrb = new StringBuffer();
            for (UUID optionId : optionIdArray) {
              Option option = field.getOption(optionId);
              if (option != null) {
                if (valueStrb.length() > 0)
                  valueStrb.append(",");

                valueStrb.append("[").append(option.getName())
                    .append("]");
              }
            }

            if (valueStrb.length() > 0)
View Full Code Here

    for (Field field : template.getFields()) {
      if (field.getType().equals(Type.t_selection)) {
        if (field.getDataType().equals(DataType.dt_single)) {
          UUID optionId = task.getSingleSelection(field.getId());
          if (optionId != null) {
            Option option = field.getOption(optionId);
            if (option != null)
              dataMap.put(field.getName(), option.getName());
          }
        } else {
          UUID[] optionIdArray = task
              .getMultiSelection(field.getId());
          if (optionIdArray != null && optionIdArray.length > 0) {
            StringBuffer valueStrb = new StringBuffer();
            for (UUID optionId : optionIdArray) {
              Option option = field.getOption(optionId);
              if (option != null) {
                if (valueStrb.length() > 0)
                  valueStrb.append(",");

                valueStrb.append("[").append(option.getName())
                    .append("]");
              }
            }

            if (valueStrb.length() > 0)
View Full Code Here

   
    for(Field field : template.getFields()){
      if(!field.getType().equals(Type.t_selection))
        continue;
       
      Option option = field.getOption(optionId);
      if(option != null)
        return option;
    }
    return null  ;
  }
View Full Code Here

      {
        UUID optionId = data.getSingleSelection(fieldId);
        if(optionId == null)
          return null;

        Option option = field.getOption(optionId);
        if(option != null)
          return "[" + option.getName() + "]";
      }
      else if(field.getDataType().equals(Field.DataType.dt_multiple))
      {
        UUID[] optionIdArray = data.getMultiSelection(fieldId);
        if(optionIdArray == null || optionIdArray.length == 0)
          return null;

        StringBuffer valueStrb = new StringBuffer();
        for(UUID optionId : optionIdArray)
        {
          Option option = field.getOption(optionId);
          if(option == null)
            continue;

          if(valueStrb.length() > 0)
            valueStrb.append(",");

          valueStrb.append("[").append(option.getName()).append("]");
        }

        return valueStrb.toString();
      }
    }
View Full Code Here

  public Option addOption()
  {
    if (this.type.equals(Field.Type.t_selection))
    {
      UUID optionId = DataAccessFactory.getInstance().newUUID("OPTI");
      Option option = new OptionImpl(optionId, getId());

      this.options.add(option);

      return option;
    }
View Full Code Here

    if (this.type.equals(Field.Type.t_selection))
    {
      Iterator<Option> optionSetItr = this.options.iterator();
      while(optionSetItr.hasNext())
      {
        Option option = optionSetItr.next();
        if(option.getId().equals(id))
          optionSetItr.remove();
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.sogou.qadev.service.cynthia.bean.Option

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.