/*
 * Copyright 2020 B2i Healthcare Pte Ltd, http://b2i.sg
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.b2international.snowowl.core.domain;

import java.io.Serializable;
import java.util.Objects;

import com.b2international.snowowl.core.uri.ComponentURI;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @since 7.7
 */
public final class SetMember implements Serializable {

	private static final long serialVersionUID = 1L;

	private final ComponentURI referencedComponentURI;
	
	private final String term;
	private final String iconId;
	
	@JsonCreator
	public SetMember(
			@JsonProperty("referencedComponentURI") ComponentURI referencedComponentURI,
			@JsonProperty("term") String term,
			@JsonProperty("iconId") String iconId) {
		this.referencedComponentURI = referencedComponentURI;
		this.term = term;
		this.iconId = iconId;
	}

	public String getIconId() {
		return iconId;
	}

	public String getTerm() {
		return term;
	}

	public ComponentURI getReferencedComponentURI() {
		return referencedComponentURI;
	}

	@JsonValue
	@Override
	public String toString() {
		return new StringBuilder()
				.append("referencedComponentURI: ")
				.append(referencedComponentURI)
				.append(", term: ")
				.append(term)
				.append(", iconId: ")
				.append(iconId)
				.toString();
	}
	
	@Override
	public int hashCode() {
		return Objects.hash(referencedComponentURI, term, iconId);
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj) return true;
		if (obj == null) return false;
		if (getClass() != obj.getClass()) return false;
		SetMember other = (SetMember) obj;
		return Objects.equals(referencedComponentURI, other.referencedComponentURI)
				&& term == other.term
				&& Objects.equals(iconId, other.iconId);
	}
}

@@ -937,16 +937,59 @@
 onValue;
+%0Aimport com.google.common.base.MoreObjects;
 %0A%0A/**%0A *
@@ -1772,25 +1772,85 @@
 urn 
-new StringBuilder
+MoreObjects.toStringHelper(%22AtcConceptEditorState%22)%0A%09%09        .omitNullValues
 ()%0A%09
@@ -1854,20 +1854,17 @@
 )%0A%09%09%09%09.a
-ppen
+d
 d(%22refer
@@ -1880,33 +1880,19 @@
 onentURI
-: %22)%0A%09%09%09%09.append(
+%22, 
 referenc
@@ -1917,38 +1917,19 @@
 %09%09.a
-ppen
+d
 d(%22
-, 
 term
-: %22)%0A%09%09%09%09.append(
+%22, 
 term
@@ -1940,40 +1940,21 @@
 %09%09.a
-ppen
+d
 d(%22
-, 
 iconId
-: %22)%0A%09%09%09%09.append(
+%22, 
 icon
@@ -1959,18 +1959,24 @@
 onId)%0A%09%09
-%09%09
+        
 .toStrin

Use MoreObjects.toStringHelper