/*
 * Copyright 2011-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.request;

import java.io.Serializable;

import com.b2international.commons.ClassUtils;

/**
 * @since 4.5
 */
public final class CommitResult implements Serializable {

	private static final long serialVersionUID = -7479022976959306232L;
	
	private final Long commitTimestamp;
	private final Object result;

	CommitResult(Long commitTimestamp, Object result) {
		this.commitTimestamp = commitTimestamp;
		this.result = result;
	}
	
	public Long getCommitTimestamp() {
		return commitTimestamp;
	}
	
	public Object getResult() {
		return result;
	}

	public <T> T getResultAs(Class<T> type) {
		return ClassUtils.checkAndCast(result, type);
	}
	
}

@@ -748,16 +748,66 @@
 ssUtils;
+%0Aimport com.b2international.index.revision.Commit;
 %0A%0A/**%0A *
@@ -967,17 +967,17 @@
 e final 
-L
+l
 ong comm
@@ -1034,17 +1034,17 @@
 tResult(
-L
+l
 ong comm
@@ -1152,17 +1152,17 @@
 %09public 
-L
+l
 ong getC
@@ -1354,13 +1354,104 @@
 ype);%0A%09%7D
+%0A%0A%09public boolean hasChanges() %7B%0A%09%09return Commit.NO_COMMIT_TIMESTAMP != commitTimestamp;%0A%09%7D
 %0A%09%0A%7D%0A

add hasChanges to CommitResult