/*
 * Copyright 2015 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

package com.hp.autonomy.types.requests.idol.actions.tags;

import lombok.Data;

import java.io.Serializable;

@SuppressWarnings({"WeakerAccess", "unused"})
@Data
public class TagName implements Serializable {
    private static final long serialVersionUID = -6221132711228529797L;
    private final String id;
    private final String name;

    public TagName(final String name, final String id) {
        this.name = name;
        this.id = id;
    }
}

@@ -247,19 +247,140 @@
 ort 
-lombok.Data
+com.fasterxml.jackson.annotation.JsonCreator;%0Aimport lombok.EqualsAndHashCode;%0Aimport lombok.Getter;%0Aimport lombok.NoArgsConstructor
 ;%0A%0Ai
@@ -459,12 +459,52 @@
 %7D)%0A@
-Data
+Getter%0A@NoArgsConstructor%0A@EqualsAndHashCode
 %0Apub
@@ -627,30 +627,24 @@
     private 
-final 
 String id;%0A 
@@ -654,22 +654,16 @@
 private 
-final 
 String n
@@ -668,16 +668,33 @@
  name;%0A%0A
+    @JsonCreator%0A
     publ
@@ -721,79 +721,712 @@
 ing 
-name, final String id) %7B%0A        this.name = name
+path) %7B%0A        name = getFieldNameFromPath(path);%0A        id = adjustFieldPath(path, name);%0A    %7D%0A%0A    private String adjustFieldPath(final String fieldPath, final String fieldName) %7B%0A        // Need an extra '/' to be able to query a field by its root path (since wildcards in Idol config file take the form */SOME_FIELD)%0A        // However, for the special autn_date field which does not have a path, adding such a '/' would break the query%0A        return fieldName.equals(fieldPath) %7C%7C fieldPath.startsWith(%22/%22) ? fieldPath : '/' + fieldPath
 ;%0A    
+%7D%0A%0A
     
-this.id = id
+private String getFieldNameFromPath(final String value) %7B%0A        return value.contains(%22/%22) ? value.substring(value.lastIndexOf('/') + 1) : value
 ;%0A  

Undo change a3351c6 as the update to haven-search-components required to use it is currently on hold