コード例 #1
0
 /**
  * Gets the best descriptive name.
  *
  * @return the best descriptive name, not null
  */
 public String getBestName() {
   Security security = getTarget();
   ObjectId objectId = getObjectId();
   ExternalIdBundle bundle = getExternalId();
   if (security != null) {
     // Try to retrieve the security's assigned name
     String name = security.getName();
     if (StringUtils.isNotBlank(name)) {
       return name;
     }
     bundle = security.getExternalIdBundle();
   }
   if (bundle != null && bundle.size() > 0) {
     if (bundle.getValue(ExternalSchemes.BLOOMBERG_TICKER) != null) {
       return bundle.getValue(ExternalSchemes.BLOOMBERG_TICKER);
     } else if (bundle.getValue(ExternalSchemes.RIC) != null) {
       return bundle.getValue(ExternalSchemes.RIC);
     } else if (bundle.getValue(ExternalSchemes.ACTIVFEED_TICKER) != null) {
       return bundle.getValue(ExternalSchemes.ACTIVFEED_TICKER);
     } else {
       return bundle.getExternalIds().iterator().next().getValue();
     }
   }
   if (objectId != null) {
     return objectId.toString();
   }
   return "";
 }
コード例 #2
0
 /**
  * Gets the time-zone. For larger regions, there can be multiple time-zones, so this is only
  * reliable for municipalities.
  *
  * @return the value of the property
  */
 public TimeZone getTimeZone() {
   String id = _externalIdBundle.getValue(ExternalSchemes.TZDB_TIME_ZONE);
   return (id != null ? TimeZone.of(id) : null);
 }
コード例 #3
0
 /**
  * Gets the country.
  *
  * @return the value of the property
  */
 public Country getCountry() {
   String code = _externalIdBundle.getValue(ExternalSchemes.ISO_COUNTRY_ALPHA2);
   return (code != null ? Country.of(code) : null);
 }
コード例 #4
0
 /**
  * Gets the currency.
  *
  * @return the value of the property
  */
 public Currency getCurrency() {
   String code = _externalIdBundle.getValue(ExternalSchemes.ISO_CURRENCY_ALPHA3);
   return (code != null ? Currency.of(code) : null);
 }