/*
 * 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;
import com.google.common.base.MoreObjects;

/**
 * @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 MoreObjects.toStringHelper("AtcConceptEditorState")
		        .omitNullValues()
				.add("referencedComponentURI", referencedComponentURI)
				.add("term", term)
				.add("iconId", 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);
	}
}

@@ -670,37 +670,8 @@
 n;%0A%0A
-import java.io.Serializable;%0A
 impo
@@ -755,337 +755,61 @@
 RI;%0A
-import com.fasterxml.jackson.annotation.JsonCreator;%0Aimport com.fasterxml.jackson.annotation.JsonProperty;%0Aimport com.fasterxml.jackson.annotation.JsonValue;%0Aimport com.google.common.base.MoreObjects;%0A%0A/**%0A * @since 7.7%0A */%0Apublic final class SetMember implements Serializable %7B%0A%0A%09private static final long serialVersionUID = 1L;
+%0A/**%0A * @since 7.7%0A */%0Apublic final class SetMember %7B
 %0A%0A%09p
@@ -924,22 +924,8 @@
 ;%0A%09%0A
-%09@JsonCreator%0A
 %09pub
@@ -942,153 +942,57 @@
 ber(
-%0A%09%09%09@JsonProperty(%22referencedComponentURI%22) ComponentURI referencedComponentURI,%0A%09%09%09@JsonProperty(%22term%22) String term,%0A%09%09%09@JsonProperty(%22iconId%22)
+ComponentURI referencedComponentURI, String term,
  Str
@@ -1297,285 +1297,8 @@
 %09%7D%0A%0A
-%09@JsonValue%0A%09@Override%0A%09public String toString() %7B%0A%09%09return MoreObjects.toStringHelper(%22AtcConceptEditorState%22)%0A%09%09        .omitNullValues()%0A%09%09%09%09.add(%22referencedComponentURI%22, referencedComponentURI)%0A%09%09%09%09.add(%22term%22, term)%0A%09%09%09%09.add(%22iconId%22, iconId)%0A%09%09        .toString();%0A%09%7D%0A%09%0A
 %09@Ov

remove JSON annotations