code: private int priority(final Value _value)
      {
          int ret = 1;
          try {
              if (StringUtils.isNotEmpty(_value.appKey)
                              && !_value.appKey.equals(AppAccessHandler.getApplicationKey())) {
                  ret = -1;
              } else {
                  final long companyId;
                  if (Context.isThreadActive()) {
                      final Company company = Context.getThreadContext().getCompany();
                      companyId = company == null ? 0 : company.getId();
                  } else {
                      companyId = 0;
                  }
                  if (_value.companyId == companyId) {
                      ret = ret + 100;
                  } else if (_value.companyId == 0) {
                      ret = ret + 10;
                  } else if (_value.companyId != companyId) {
                      ret = -1;
                  }
              }
          } catch (final EFapsException e) {
              SystemConfiguration.LOG.error("Catched", e);
          }
          return ret;
      }
docs: Priority.
  
  @param _value the value
  @return the int