package com.clxcommunications.xms.api;

/*-
 * #%L
 * SDK for CLX XMS
 * %%
 * Copyright (C) 2016 CLX Communications
 * %%
 * 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.
 * #L%
 */

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;

import org.immutables.value.Value;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Representation of a group identifier. These are in the JSON representation
 * simply string literals but they are within the Java API represented in a more
 * type safe way using this class.
 * <p>
 * To fetch the literal batch identifier use the {@link #toString()} method.
 */
@Value.Immutable
@ValueStylePackageDirect
@ParametersAreNonnullByDefault
public abstract class GroupId implements Comparable<GroupId> {

	/**
	 * Builds an immutable {@link GroupId} having the given literal
	 * representation.
	 * 
	 * @param id
	 *            the group id
	 * @return a non-null group ID
	 */
	@JsonCreator
	@Nonnull
	public static GroupId of(String id) {
		return GroupIdImpl.of(id);
	}

	/**
	 * The literal string representation of this group identifier.
	 * 
	 * @return a non-null identifier
	 */
	protected abstract String id();

	@Override
	public int compareTo(GroupId o) {
		return id().compareTo(o.id());
	}

	/**
	 * The string representation of this group identifier.
	 * 
	 * @return a non-null string
	 */
	@JsonValue
	@Override
	public String toString() {
		return id();
	}

}

@@ -1722,16 +1722,28 @@
 er%0A%09 */%0A
+%09@JsonValue%0A
 %09protect
@@ -1952,28 +1952,16 @@
 ng%0A%09 */%0A
-%09@JsonValue%0A
 %09@Overri

Move `@JsonValue` to the literal representation