/**
 * Copyright 2008-2009 DRIVER PROJECT (ICM UW)
 * Original author: Marek Horst
 *
 * 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.
 */
/**
 * Created on 2007-10-24
 * $Id:FeedObject.java 2509 2007-10-29 14:27:03Z icmdriver $
 */
package eu.dnetlib.data.index.ws.feed;

import java.util.List;

import eu.dnetlib.common.ws.harv.FieldData;
import eu.dnetlib.data.index.ws.commons.event.IndexError;

/**
 * Feed object contains data extracted from processed objects used by
 * index facade during feed process.
 * @author wojtek
 */
public class FeedObject {

	private String id;
	private List<FieldData> fields;
	private String resultContent;
	private boolean deleted = false;
	private IndexError error;


	public List<FieldData> getFields() {
		return fields;
	}

	public void setFields(List<FieldData> fields) {
		this.fields = fields;
	}
	
	/**
	 * Object id.
	 * TODO: do objects have universal id? 
	 */
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	/**
	 * Returns error if any occured during xml parsing.
	 * @return error if any occured during xml parsing
	 */
	public IndexError getError() {
		return error;
	}

	public void setError(IndexError error) {
		this.error = error;
	}

	/**
	 * Returns result content.
	 * @return result content
	 */
	public String getResultContent() {
		return resultContent;
	}

	/**
	 * Sets result content.
	 * @param resultContent
	 */
	public void setResultContent(String resultContent) {
		this.resultContent = resultContent;
	}

	/**
	 * Returns true if record is deleted.
	 * @return true if record is deleted
	 */
	public boolean isDeleted() {
		return deleted;
	}

	/**
	 * Sets record deletion flag.
	 * @param deleted
	 */
	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}


}
