/** * Methods to deal with nested TagEvent JSON structure. Jackson black magic can deal with it using * annotations. So some attributes have to be deserialized in an alternative way. * @param geolocation */ @JsonSetter("geolocation") public void setGeolocation(LinkedHashMap geolocation) { try { if (geolocation.containsKey("zone")) this.geoZone= geolocation.get("zone").toString(); if (geolocation.containsKey("latitude")) this.latitude= Double.parseDouble(geolocation.get("latitude").toString()); if (geolocation.containsKey("longitude")) this.longitude= Double.parseDouble(geolocation.get("longitude").toString()); if (geolocation.containsKey("region") && geolocation.get("region") instanceof LinkedHashMap) { LinkedHashMap<String, String> region= (LinkedHashMap) geolocation.get("region"); if (region.containsKey("country")) this.geoRegionCountry= region.get("country").toString(); if (region.containsKey("locality")) this.geoRegionLocality= region.get("locality").toString(); } } catch (Exception ex) { log.error("Unable to parse the TagEvent(geolocation): " + geolocation + ", Exception: " + ex.getMessage()); } }
/** * Sets Date when the asset was purchased or licensed. * @param date Date when the asset was purchased or licensed. * @throws StockException if date format is not valid */ @JsonSetter("date") public void setDate(final String date) throws StockException { String formatString = "yyyy-MM-dd hh:mm:ss"; // date format with milliseconds SimpleDateFormat format = new SimpleDateFormat( formatString + ".SSS"); // date format without milliseconds SimpleDateFormat formatWithoutMS = new SimpleDateFormat( formatString); try { if (date.length() <= formatString.length()) { this.mDate = formatWithoutMS.parse(date); } else { this.mDate = format.parse(date); } } catch (ParseException e) { throw new StockException("Could not parse the date string"); } }
/** * Sets Full quota of the user available entitlements. * @param node object containing full quota of user available entitlements. * @throws Exception if could not parse node object */ @JsonSetter("full_entitlement_quota") public void setFullEntitlementQuota( final JsonNode node) throws Exception { if (node != null && node.isObject()) { ObjectMapper mapper = new ObjectMapper(); this.mFullEntitlementQuota = mapper.readValue( node.toString(), LicenseEntitlementQuota.class); } }
@JsonSetter("violincello") public void setViolincello(int violincello) { _violincello = violincello; }
@JsonSetter("username") public void setUsername(String username) { _username = username; }
@JsonSetter("violin2") public void setViolin2(int violin2) { _violin2 = violin2; }
@JsonSetter("tube") public void setTube(int tube) { _tube = tube; }
/** * Sets quantity of remaining licenses available for the user. * @param quota license quantity */ @JsonSetter("quota") public void setQuota(final Integer quota) { this.mQuota = quota; }
@JsonSetter("trombone") public void setTrombone(int trombone) { _trombone = trombone; }
@JsonSetter("refresh-token-validity-seconds") public void setRefreshTokenValiditySecondsAlias(Integer refreshTokenValiditySeconds) { this.refreshTokenValiditySeconds = refreshTokenValiditySeconds; }
@JsonSetter("viola") public void setViola(int viola) { _viola = viola; }
/** * Sets Asset licensing state. * @param licenseState Asset licensing state */ @JsonSetter("license") public void setLicenseState(final AssetLicenseState licenseState) { this.mLicenseState = licenseState; }
@JsonSetter("phone_number") public void setPhoneNumber(String phoneNumber) { _phoneNumber = phoneNumber; }
/** * Sets Type of the licensed asset. * @param contentType Type of the licensed asset. */ @JsonSetter("content_type") public void setContentType(final String contentType) { this.mContentType = contentType; }
/** SETTER * TODO: Write general description for this method */ @JsonSetter("messages") public void setMessages (List<Object> value) { this.messages = value; }
/** SETTER * TODO: Write general description for this method */ @JsonSetter("status") public void setStatus (String value) { this.status = value; }
/** * Sets Video quota for CCE 1st generation. * @param videoQuota video quota */ @JsonSetter("video_quota") public void setVideoQuota(final Integer videoQuota) { this.mVideoQuota = videoQuota; }
/** SETTER * TODO: Write general description for this method */ @JsonSetter("delivery_reports") public void setDeliveryReports (List<Object> value) { this.deliveryReports = value; }
/** * Sets Standard credits quota for CCE 3rd generation. * @param standardCreditsQuota standard credits quota */ @JsonSetter("standard_credits_quota") public void setStandardCreditsQuota(final Integer standardCreditsQuota) { this.mStandardCreditsQuota = standardCreditsQuota; }
/** * Sets Premium credits quota for CCE 3rd generation. * @param premiumCreditsQuota premium credits quota */ @JsonSetter("premium_credits_quota") public void setPremiumCreditsQuota(final Integer premiumCreditsQuota) { this.mPremiumCreditsQuota = premiumCreditsQuota; }
/** SETTER * TODO: Write general description for this method */ @JsonSetter("delivery_report_ids") public void setDeliveryReportIds (List<UUID> value) { this.deliveryReportIds = value; }
@JsonSetter("initials") public void setInitials(String initials) { _initials = initials; }
/** * Sets URL from which the thumbnail can be downloaded. * @param url URL from which the thumbnail can be downloaded. */ @JsonSetter("url") public void setUrl(final String url) { this.mUrl = url; }
@JsonSetter("oboe") public void setOboe(int oboe) { _oboe = oboe; }
/** * Sets Width of asset thumbnail in pixels. * @param width Width of asset thumbnail in pixels. */ @JsonSetter("width") public void setWidth(final Integer width) { this.mWidth = width; }
/** * Sets Height of asset thumbnail in pixels. * @param height Height of asset thumbnail in pixels. */ @JsonSetter("height") public void setHeight(final Integer height) { this.mHeight = height; }
/** * Sets Type of the complementary asset. * @param contentType Type of the complementary asset. */ @JsonSetter("content_type") public void setContentType(final String contentType) { this.mContentType = contentType; }
/** * Sets Width of complementary asset in pixels. * @param width Width of complementary asset in pixels. */ @JsonSetter("width") public void setWidth(final Integer width) { this.mWidth = width; }
/** * Set Height of complementary asset in pixels. * @param height Height of complementary asset in pixels. */ @JsonSetter("height") public void setHeight(final Integer height) { this.mHeight = height; }
@JsonSetter("gender") public void setGender(Gender gender) { _gender = gender; }
/** * @param licenseDate License Date */ @JsonSetter("license_date") public void setLicenseDate(final String licenseDate) { this.mLicenseDate = licenseDate; }
/** * @param downloadUrl Download url of asset */ @JsonSetter("download_url") public void setDownloadUrl(final String downloadUrl) { this.mDownloadUrl = downloadUrl; }
@JsonSetter("special_instrumentation_count") public void setSpecialInstrumentationCount(int specialInstrumentCount) { _specialInstrumentationCount = specialInstrumentCount; }
@JsonSetter("Owner") public void setOwner(String owner) { this.owner = owner; }
@JsonSetter("composer") public void setComposer(String composer) { _composer = composer; }
@JsonSetter("account") public void setAccount(Account account) { _account = account; }
@JsonSetter("key") public void setKey(String key) { _key = key; }
/** SETTER * TODO: Write general description for this method */ @JsonSetter("delivery_report_ids") public void setDeliveryReportIds (List<String> value) { this.deliveryReportIds = value; }
@JsonSetter public void setFiles(Map<String, String> files) { this.files = files; }
@JsonSetter("email") public void setEmail(String email) { _email = email; }