Ejemplo n.º 1
0
 @Override
 @Nullable
 public String getTrackableCodeFromUrl(@NonNull final String url) {
   final String geocode = StringUtils.upperCase(StringUtils.substringAfterLast(url, "swaggie/"));
   if (canHandleTrackable(geocode)) {
     return geocode;
   }
   return null;
 }
Ejemplo n.º 2
0
 @Nullable
 public static String getGeocodeFromURL(@Nullable final String url) {
   if (url == null) {
     return null;
   }
   for (final IConnector connector : CONNECTORS) {
     @Nullable final String geocode = connector.getGeocodeFromUrl(url);
     if (StringUtils.isNotBlank(geocode)) {
       return StringUtils.upperCase(geocode);
     }
   }
   return null;
 }
Ejemplo n.º 3
0
  /** Create the object used to generate the CodeForest xml. */
  public FlatFaultClassification build() {

    FlatFaultClassification faultClassification = new FlatFaultClassification();
    if (heuristic != null) {
      faultClassification.setHeuristic(
          StringUtils.upperCase(
              StringUtils.removeEndIgnoreCase(heuristic.getClass().getSimpleName(), "heuristic")));
    }
    faultClassification.setTimeSpent(timeSpent);
    faultClassification.setRequirementType(requirementType);
    faultClassification.setRequirements(requirements);
    faultClassification.setProject(project);

    return faultClassification;
  }
Ejemplo n.º 4
0
  private void handleSpecialCommand(String string) {
    ConsoleCommand c = ConsoleCommand.valueOf(StringUtils.upperCase(string));

    if (c == ConsoleCommand.RETRY) {
      if (cmd == null) {
        LOG.warn("no command to retry");
      } else {
        runNewCommand(cmd.getSystem(), cmd.getCommand().toString());
      }
    } else if (c == ConsoleCommand.EXIT) {
      System.exit(0);
    } else if (c == ConsoleCommand.UPDATE) {
      // birdMan.initConfig();
    } else if (c == ConsoleCommand.BROKER) {
      // bmConfig.setBroker(true);
      // bmConfig.setLoopInterval(0);
      // server.runAsServer();
    }
  }
 public List<Conversation> findBy(
     final String queueName, final int pageFrom, final int pageSize, String order) {
   List<Conversation> result = new ArrayList<Conversation>();
   List<String> sort =
       template.sort(
           SortQueryBuilder.sort(queueName)
               .order(SortParameters.Order.valueOf(StringUtils.upperCase(order)))
               .limit(pageFrom, pageSize)
               .build());
   for (String covId : sort) {
     Conversation c = findBy(Long.valueOf(covId));
     String messageQueue = KeyUtils.conversationMessage(Long.valueOf(covId));
     for (String msgId : template.opsForList().range(messageQueue, 0, 0)) {
       c.addMessage(messageDao.findBy(msgId));
     }
     result.add(c);
   }
   return result;
 }
  private void fillCountryListView() {
    String userCountryCode;
    if (mUser != null && StringUtils.isNotBlank(mUser.getCountry())) {
      userCountryCode = mUser.getCountry();
    } else {
      TelephonyManager tm =
          (TelephonyManager) getContext().getSystemService(getContext().TELEPHONY_SERVICE);
      userCountryCode = StringUtils.upperCase(tm.getNetworkCountryIso());
    }

    String preSelection = null;
    try {
      String countryPhonePrefix;
      for (CountryVO countryVO : Utils.countryList()) {
        countryPhonePrefix = countryVO.getPhonePrefix();
        mCountriesView2VOMap.put(countryVO.getPhonePrefix(), countryVO);
        // track entry
        if (StringUtils.equals(userCountryCode, countryVO.getCode())) {
          preSelection = countryPhonePrefix;
        }
      }
    } catch (Exception e) {
      // muted
    }

    List<String> _countries = new ArrayList<>(mCountriesView2VOMap.keySet());
    // spinner stuff
    ArrayAdapter<String> mCountryListAdapter =
        new ArrayAdapter<String>(getActivity(), R.layout.phoneverify_prefix, _countries);
    mCountryListView.setAdapter(mCountryListAdapter);
    // default setup
    if (StringUtils.isNotBlank(preSelection)) {
      int preSelectionIdx = Collections.binarySearch(_countries, preSelection);
      mCountryListView.setSelection(preSelectionIdx);
    }
  }
Ejemplo n.º 7
0
 /**
  * fieldOperator是否需要括号
  *
  * @return
  */
 public boolean isFieldOperatorNeedBracket() {
   return StringUtils.indexOf(StringUtils.upperCase(fieldOperator), "IN") != -1;
 }