/**
 * Copyright 2015 IBM Corp. All Rights Reserved.
 *
 * 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.ibm.watson.developer_cloud.speech_to_text.v1.model;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.annotations.SerializedName;
import com.ibm.watson.developer_cloud.util.GsonSingleton;

/**
 * The Class Transcript.
 */
public class Transcript {

	/** The alternatives. */
	private List<SpeechAlternative> alternatives = new ArrayList<SpeechAlternative>();
	
	/** The _final. */
	@SerializedName("final")
	private boolean _final;

	/**
	 * Gets the alternatives.
	 * 
	 * @return The alternatives
	 */
	public List<SpeechAlternative> getAlternatives() {
		return alternatives;
	}

	/**
	 * Sets the alternatives.
	 * 
	 * @param alternatives
	 *            The alternatives
	 */
	public void setAlternatives(final List<SpeechAlternative> alternatives) {
		this.alternatives = alternatives;
	}

	/**
	 * With alternatives.
	 * 
	 * @param alternatives
	 *            the alternatives
	 * @return the speech
	 */
	public Transcript withAlternatives(
			final List<SpeechAlternative> alternatives) {
		this.alternatives = alternatives;
		return this;
	}

	/**
	 * Checks if is final.
	 * 
	 * @return The _final
	 */
	public boolean isFinal() {
		return _final;
	}

	/**
	 * Sets the final.
	 * 
	 * @param _final
	 *            The final
	 */
	public void setFinal(final boolean _final) {
		this._final = _final;
	}

	/**
	 * With final.
	 * 
	 * @param _final
	 *            the _final
	 * @return the speech
	 */
	public Transcript withFinal(final boolean _final) {
		this._final = _final;
		return this;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		Transcript that = (Transcript) o;

		if (_final != that._final) return false;
		return alternatives.equals(that.alternatives);

	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		int result = alternatives.hashCode();
		result = 31 * result + (_final ? 1 : 0);
		return result;
	}

	/*
         * (non-Javadoc)
         *
         * @see java.lang.Object#toString()
         */
	@Override
	public String toString() {
		return getClass().getName() + " "
				+ GsonSingleton.getGson().toJson(this);
	}
}

/**
 * Copyright 2015 IBM Corp. All Rights Reserved.
 *
 * 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.ibm.watson.developer_cloud.speech_to_text.v1.model;

import java.util.List;

import com.google.gson.annotations.SerializedName;
import com.ibm.watson.developer_cloud.service.model.GenericModel;

/**
 * The Class Transcript.
 */
public class Transcript extends GenericModel {

	/** The _final. */
	@SerializedName("final")
	private boolean _final;
	
	/** The alternatives. */
	private List<SpeechAlternative> alternatives;

	/**
	 * Gets the alternatives.
	 * 
	 * @return The alternatives
	 */
	public List<SpeechAlternative> getAlternatives() {
		return alternatives;
	}

	/**
	 * Checks if is final.
	 * 
	 * @return The _final
	 */
	public boolean isFinal() {
		return _final;
	}

	/**
	 * Sets the alternatives.
	 * 
	 * @param alternatives
	 *            The alternatives
	 */
	public void setAlternatives(final List<SpeechAlternative> alternatives) {
		this.alternatives = alternatives;
	}

	/**
	 * Sets the final.
	 * 
	 * @param _final
	 *            The final
	 */
	public void setFinal(final boolean _final) {
		this._final = _final;
	}

	/**
	 * With alternatives.
	 * 
	 * @param alternatives
	 *            the alternatives
	 * @return the speech
	 */
	public Transcript withAlternatives(
			final List<SpeechAlternative> alternatives) {
		this.alternatives = alternatives;
		return this;
	}
}

update to speech to text model