All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.splout.db.common.BaseBean Maven / Gradle / Ivy

Go to download

Splout is a read only, horizontally scalable SQL database that plays well with Hadoop.

There is a newer version: 0.3.0
Show newest version
package com.splout.db.common;

/*
 * #%L
 * Splout SQL commons
 * %%
 * Copyright (C) 2012 Datasalt Systems S.L.
 * %%
 * 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 java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * For convenience, beans will extend this class for having a neat toString() method.
 */
public class BaseBean {
	
	private final static Log log = LogFactory.getLog(BaseBean.class);
	
	public String toString() {
		try {
      return BeanUtils.describe(this).toString();
    } catch(IllegalAccessException e) {
    	log.error("Error in toString() method", e);
    } catch(InvocationTargetException e) {
    	log.error("Error in toString() method", e);
    } catch(NoSuchMethodException e) {
    	log.error("Error in toString() method", e);
    }
    return super.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy