Check if a timed metadata represents an ad placement opportunity

You need to check if a timed metadata represents an ad placement opportunity.
  • @param timedMetadata is the timed metadata to be checked
  • @return true if the timed metadata is an ad placement
  • @return false if the timed metadata is not an ad placement
Add the following code:
private boolean isPlacementOpportunity(TimedMetadata timedMetadata) {
	Metadata metadata = timedMetadata.getMetadata();
	return timedMetadata.getName().equals(OPPORTUNITY_TAG_NAME)
		&& metadata != null
		&& metadata.containsKey(OPPORTUNITY_DURATION_KEY);
	}
}