// Path: src/main/java/org/scrutmydocs/webapp/api/common/RestAPIException.java
// public class RestAPIException extends Exception {
// 	private static final long serialVersionUID = 1L;
// 
// 	public RestAPIException(String message) {
// 		super(message);
// 	}
// 
// 	public RestAPIException(Exception e) {
// 		super(e.getMessage());
// 	}
// 
// }


import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import org.scrutmydocs.webapp.api.common.RestAPIException;

/*
 * Licensed to scrutmydocs.org (the "Author") under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. Author licenses this
 * file to you 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 org.scrutmydocs.webapp.api.common.data;




public class RestResponse<T> implements Serializable {

	private static final long serialVersionUID = 1L;

	private boolean ok;
	private String errors[];
	private T object;

	/**
	 * Default constructor : we suppose here that ok = true
	 */
	public RestResponse() {
		this.ok = true;
	}
	
	/**
	 * We can get an object back, so there is no error and ok=true
	 * @param object
	 */
	public RestResponse(T object) {
		this.object = object;
		this.ok = true;
	}


	/**
	 * We build a response when we have errors
	 * @param errors
	 */
	public RestResponse(String[] errors) {
		this.errors = errors;
		this.ok = false;
	}

	/**
	 * We build a response when we have a single exception
	 * @param e
	 */

// Path: src/main/java/org/scrutmydocs/webapp/api/common/RestAPIException.java
// public class RestAPIException extends Exception {
// 	private static final long serialVersionUID = 1L;
// 
// 	public RestAPIException(String message) {
// 		super(message);
// 	}
// 
// 	public RestAPIException(Exception e) {
// 		super(e.getMessage());
// 	}
// 
// }


// Path: src/main/java/org/scrutmydocs/webapp/api/common/data/RestResponse.java
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import org.scrutmydocs.webapp.api.common.RestAPIException;

/*
 * Licensed to scrutmydocs.org (the "Author") under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. Author licenses this
 * file to you 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 org.scrutmydocs.webapp.api.common.data;




public class RestResponse<T> implements Serializable {

	private static final long serialVersionUID = 1L;

	private boolean ok;
	private String errors[];
	private T object;

	/**
	 * Default constructor : we suppose here that ok = true
	 */
	public RestResponse() {
		this.ok = true;
	}
	
	/**
	 * We can get an object back, so there is no error and ok=true
	 * @param object
	 */
	public RestResponse(T object) {
		this.object = object;
		this.ok = true;
	}


	/**
	 * We build a response when we have errors
	 * @param errors
	 */
	public RestResponse(String[] errors) {
		this.errors = errors;
		this.ok = false;
	}

	/**
	 * We build a response when we have a single exception
	 * @param e
	 */

	public RestResponse(RestAPIException e) {
