static AnyPut toAnyPut(final AnyPut outputAnyPut, final Object obj, final NamingPolicy namingPolicy) {
        if (obj instanceof AnyPut) {
            if (outputAnyPut != null) {
                throw new IllegalArgumentException("Merge is not supported. The specified entity object is already a AnyPut and outputAnyPut is not null");
            }

            return (AnyPut) obj;
        }

        final Class<?> cls = obj.getClass();

        checkEntityClass(cls);

        final EntityInfo entityInfo = ParserUtil.getEntityInfo(cls);
        final Method rowKeySetMethod = getRowKeySetMethod(cls);
        final Method rowKeyGetMethod = rowKeySetMethod == null ? null : ClassUtil.getPropGetMethod(cls, ClassUtil.getPropNameByMethod(rowKeySetMethod));

        if (outputAnyPut == null && rowKeySetMethod == null) {
            throw new IllegalArgumentException(
                    "Row key property is required to create AnyPut instance. But no row key property found in class: " + ClassUtil.getCanonicalClassName(cls));
        }

        final AnyPut anyPut = outputAnyPut == null ? new AnyPut(ClassUtil.getPropValue(obj, rowKeyGetMethod)) : outputAnyPut;
        final Map<String, Method> familyGetMethodMap = ClassUtil.getPropGetMethodList(cls);

        String familyName = null;
        PropInfo familyPropInfo = null;
        String columnName = null;
        PropInfo columnPropInfo = null;
        Collection<HBaseColumn<?>> columnColl = null;
        Map<Long, HBaseColumn<?>> columnMap = null;
        HBaseColumn<?> column = null;
        Object propValue = null;

        for (Map.Entry<String, Method> familyGetMethodEntry : familyGetMethodMap.entrySet()) {
            familyPropInfo = entityInfo.getPropInfo(familyGetMethodEntry.getKey());

            if (rowKeyGetMethod != null && familyPropInfo.getMethod.equals(rowKeyGetMethod)) {
                continue;
            }

            familyName = formatName(familyGetMethodEntry.getKey(), namingPolicy);
            propValue = ClassUtil.getPropValue(obj, familyPropInfo.getMethod);

            if (propValue == null) {
                continue;
            }

            if (familyPropInfo.type.isEntity()) {
                final Class<?> propEntityClass = familyPropInfo.type.clazz();
                final EntityInfo propEntityInfo = ParserUtil.getEntityInfo(propEntityClass);
                final Object propEntity = propValue;

                final Map<String, Method> columnGetMethodMap = ClassUtil.getPropGetMethodList(propEntityClass);

                for (Map.Entry<String, Method> columnGetMethodEntry : columnGetMethodMap.entrySet()) {
                    columnPropInfo = propEntityInfo.getPropInfo(columnGetMethodEntry.getKey());
                    columnName = formatName(columnGetMethodEntry.getKey(), namingPolicy);

                    propValue = ClassUtil.getPropValue(propEntity, columnPropInfo.getMethod);

                    if (propValue == null) {
                        continue;
                    }

                    if (columnPropInfo.type.isMap() && columnPropInfo.type.getParameterTypes()[1].clazz().equals(HBaseColumn.class)) {
                        columnMap = (Map<Long, HBaseColumn<?>>) propValue;

                        for (HBaseColumn<?> e : columnMap.values()) {
                            anyPut.addColumn(familyName, columnName, e.version(), e.value());

                        }
                    } else if (columnPropInfo.type.isCollection() && columnPropInfo.type.getParameterTypes()[0].clazz().equals(HBaseColumn.class)) {
                        columnColl = (Collection<HBaseColumn<?>>) propValue;

                        for (HBaseColumn<?> e : columnColl) {
                            anyPut.addColumn(familyName, columnName, e.version(), e.value());

                        }
                    } else if (columnPropInfo.type.clazz().equals(HBaseColumn.class)) {
                        column = (HBaseColumn<?>) propValue;
                        anyPut.addColumn(familyName, columnName, column.version(), column.value());
                    } else {
                        anyPut.addColumn(familyName, columnName, propValue);
                    }
                }
            } else if (familyPropInfo.type.isMap() && familyPropInfo.type.getParameterTypes()[1].clazz().equals(HBaseColumn.class)) {
                columnMap = (Map<Long, HBaseColumn<?>>) propValue;

                for (HBaseColumn<?> e : columnMap.values()) {
                    anyPut.addColumn(familyName, EMPTY_QULIFIER, e.version(), e.value());

                }
            } else if (familyPropInfo.type.isCollection() && familyPropInfo.type.getParameterTypes()[0].clazz().equals(HBaseColumn.class)) {
                columnColl = (Collection<HBaseColumn<?>>) propValue;

                for (HBaseColumn<?> e : columnColl) {
                    anyPut.addColumn(familyName, EMPTY_QULIFIER, e.version(), e.value());

                }
            } else if (familyPropInfo.type.clazz().equals(HBaseColumn.class)) {
                column = (HBaseColumn<?>) propValue;
                anyPut.addColumn(familyName, EMPTY_QULIFIER, column.version(), column.value());
            } else {
                anyPut.addColumn(familyName, EMPTY_QULIFIER, propValue);
            }
        }

        return anyPut;
    }
static AnyPut toAnyPut ( final AnyPut outputAnyPut , final Object obj , final NamingPolicy namingPolicy ) { if ( obj instanceof AnyPut ) { if ( outputAnyPut != null ) { throw new IllegalArgumentException ( "Merge is not supported. The specified entity object is already a AnyPut and outputAnyPut is not null" ) ; } return ( AnyPut ) obj ; } final Class < ? > cls = obj . getClass ( ) ; checkEntityClass ( cls ) ; final EntityInfo entityInfo = ParserUtil . getEntityInfo ( cls ) ; final Method rowKeySetMethod = getRowKeySetMethod ( cls ) ; final Method rowKeyGetMethod = rowKeySetMethod == null ? null : ClassUtil . getPropGetMethod ( cls , ClassUtil . getPropNameByMethod ( rowKeySetMethod ) ) ; if ( outputAnyPut == null && rowKeySetMethod == null ) { throw new IllegalArgumentException ( "Row key property is required to create AnyPut instance. But no row key property found in class: " + ClassUtil . getCanonicalClassName ( cls ) ) ; } final AnyPut anyPut = outputAnyPut == null ? new AnyPut ( ClassUtil . getPropValue ( obj , rowKeyGetMethod ) ) : outputAnyPut ; final Map < String , Method > familyGetMethodMap = ClassUtil . getPropGetMethodList ( cls ) ; String familyName = null ; PropInfo familyPropInfo = null ; String columnName = null ; PropInfo columnPropInfo = null ; Collection < HBaseColumn < ? > > columnColl = null ; Map < Long , HBaseColumn < ? > > columnMap = null ; HBaseColumn < ? > column = null ; Object propValue = null ; for ( Map . Entry < String , Method > familyGetMethodEntry : familyGetMethodMap . entrySet ( ) ) { familyPropInfo = entityInfo . getPropInfo ( familyGetMethodEntry . getKey ( ) ) ; if ( rowKeyGetMethod != null && familyPropInfo . getMethod . equals ( rowKeyGetMethod ) ) { continue ; } familyName = formatName ( familyGetMethodEntry . getKey ( ) , namingPolicy ) ; propValue = ClassUtil . getPropValue ( obj , familyPropInfo . getMethod ) ; if ( propValue == null ) { continue ; } if ( familyPropInfo . type . isEntity ( ) ) { final Class < ? > propEntityClass = familyPropInfo . type . clazz ( ) ; final EntityInfo propEntityInfo = ParserUtil . getEntityInfo ( propEntityClass ) ; final Object propEntity = propValue ; final Map < String , Method > columnGetMethodMap = ClassUtil . getPropGetMethodList ( propEntityClass ) ; for ( Map . Entry < String , Method > columnGetMethodEntry : columnGetMethodMap . entrySet ( ) ) { columnPropInfo = propEntityInfo . getPropInfo ( columnGetMethodEntry . getKey ( ) ) ; columnName = formatName ( columnGetMethodEntry . getKey ( ) , namingPolicy ) ; propValue = ClassUtil . getPropValue ( propEntity , columnPropInfo . getMethod ) ; if ( propValue == null ) { continue ; } if ( columnPropInfo . type . isMap ( ) && columnPropInfo . type . getParameterTypes ( ) [ 1 ] . clazz ( ) . equals ( HBaseColumn . class ) ) { columnMap = ( Map < Long , HBaseColumn < ? > > ) propValue ; for ( HBaseColumn < ? > e : columnMap . values ( ) ) { anyPut . addColumn ( familyName , columnName , e . version ( ) , e . value ( ) ) ; } } else if ( columnPropInfo . type . isCollection ( ) && columnPropInfo . type . getParameterTypes ( ) [ 0 ] . clazz ( ) . equals ( HBaseColumn . class ) ) { columnColl = ( Collection < HBaseColumn < ? > > ) propValue ; for ( HBaseColumn < ? > e : columnColl ) { anyPut . addColumn ( familyName , columnName , e . version ( ) , e . value ( ) ) ; } } else if ( columnPropInfo . type . clazz ( ) . equals ( HBaseColumn . class ) ) { column = ( HBaseColumn < ? > ) propValue ; anyPut . addColumn ( familyName , columnName , column . version ( ) , column . value ( ) ) ; } else { anyPut . addColumn ( familyName , columnName , propValue ) ; } } } else if ( familyPropInfo . type . isMap ( ) && familyPropInfo . type . getParameterTypes ( ) [ 1 ] . clazz ( ) . equals ( HBaseColumn . class ) ) { columnMap = ( Map < Long , HBaseColumn < ? > > ) propValue ; for ( HBaseColumn < ? > e : columnMap . values ( ) ) { anyPut . addColumn ( familyName , EMPTY_QULIFIER , e . version ( ) , e . value ( ) ) ; } } else if ( familyPropInfo . type . isCollection ( ) && familyPropInfo . type . getParameterTypes ( ) [ 0 ] . clazz ( ) . equals ( HBaseColumn . class ) ) { columnColl = ( Collection < HBaseColumn < ? > > ) propValue ; for ( HBaseColumn < ? > e : columnColl ) { anyPut . addColumn ( familyName , EMPTY_QULIFIER , e . version ( ) , e . value ( ) ) ; } } else if ( familyPropInfo . type . clazz ( ) . equals ( HBaseColumn . class ) ) { column = ( HBaseColumn < ? > ) propValue ; anyPut . addColumn ( familyName , EMPTY_QULIFIER , column . version ( ) , column . value ( ) ) ; } else { anyPut . addColumn ( familyName , EMPTY_QULIFIER , propValue ) ; } } return anyPut ; }
@param obj entity with getter/setter methods
@param namingPolicy
@return