Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #710 from salesforce/bsura-patch-2
Browse files Browse the repository at this point in the history
Change no of tags allowed from 7 to 50.
  • Loading branch information
dilipdevaraj-sfdc committed Jan 22, 2018
2 parents 1ad0933 + d814f54 commit ee3e625
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -47,6 +47,8 @@
*/
@SuppressWarnings("serial")
public abstract class TSDBEntity implements Serializable {

private static final int NUM_TAGS = 50;

//~ Instance fields ******************************************************************************************************************************

Expand Down Expand Up @@ -161,7 +163,7 @@ public void setTags(Map<String, String> tags) {

public static void validateTags(Map<String, String> tags) {
if(tags != null) {
requireArgument(tags.size() <= 7, "No. of tags = " + tags.size() + ". Too many tags!!!");
requireArgument(tags.size() <= NUM_TAGS, "No. of tags = " + tags.size() + ". Too many tags!!!");

for(Map.Entry<String, String> entry : tags.entrySet()) {
String key = entry.getKey();
Expand Down Expand Up @@ -247,7 +249,7 @@ private void setTag(String key, String value, boolean isUserTag) {
if (value == null || value.isEmpty()) {
_tags.remove(key);
} else {
requireArgument(_tags.size() < 7 || _tags.containsKey(key), "No. of tags = " + _tags.size() + ". Cannot add more tags!!!");
requireArgument(_tags.size() < NUM_TAGS || _tags.containsKey(key), "No. of tags = " + _tags.size() + ". Cannot add more tags!!!");
_tags.put(key, value);
}
}
Expand Down

0 comments on commit ee3e625

Please sign in to comment.