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

Commit

Permalink
Change no of tags allowed from 7 to 50.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsura committed Jan 22, 2018
1 parent 1ad0933 commit d814f54
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
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 d814f54

Please sign in to comment.