protected void addAttributes(Entity entity, Map<String, Object> attributes) {
        if (attributes != null) {
            for (Entry<String, Object> pairs : attributes.entrySet()) {
                entity.set(pairs.getKey(), pairs.getValue());
            }
        }
    }
protected void addAttributes ( Entity entity , Map < String , Object > attributes ) { if ( attributes != null ) { for ( Entry < String , Object > pairs : attributes . entrySet ( ) ) { entity . set ( pairs . getKey ( ) , pairs . getValue ( ) ) ; } } }
Fill attributes for specified entity.

@param entity     entity to fill.
@param attributes Map of attributes on filling to entity.