package org.gcube.portlet.user.userstatisticsportlet.shared;

import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.user.client.rpc.impl.ReflectionHelper;

@SuppressWarnings("deprecation")
public class PostsStatsBean_FieldSerializer implements com.google.gwt.user.client.rpc.impl.TypeHandler {
  @com.google.gwt.core.client.UnsafeNativeLong
  private static native long getCommentsReceived(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance) /*-{
    return instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::commentsReceived;
  }-*/;
  
  @com.google.gwt.core.client.UnsafeNativeLong
  private static native void setCommentsReceived(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance, long value) 
  /*-{
    instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::commentsReceived = value;
  }-*/;
  
  @com.google.gwt.core.client.UnsafeNativeLong
  private static native long getFeeds(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance) /*-{
    return instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::feeds;
  }-*/;
  
  @com.google.gwt.core.client.UnsafeNativeLong
  private static native void setFeeds(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance, long value) 
  /*-{
    instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::feeds = value;
  }-*/;
  
  @com.google.gwt.core.client.UnsafeNativeLong
  private static native long getLikesReceived(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance) /*-{
    return instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::likesReceived;
  }-*/;
  
  @com.google.gwt.core.client.UnsafeNativeLong
  private static native void setLikesReceived(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance, long value) 
  /*-{
    instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::likesReceived = value;
  }-*/;
  
  public static void deserialize(SerializationStreamReader streamReader, org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance) throws SerializationException {
    setCommentsReceived(instance, streamReader.readLong());
    setFeeds(instance, streamReader.readLong());
    setLikesReceived(instance, streamReader.readLong());
    
  }
  
  public static org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instantiate(SerializationStreamReader streamReader) throws SerializationException {
    return new org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean();
  }
  
  public static void serialize(SerializationStreamWriter streamWriter, org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance) throws SerializationException {
    streamWriter.writeLong(getCommentsReceived(instance));
    streamWriter.writeLong(getFeeds(instance));
    streamWriter.writeLong(getLikesReceived(instance));
    
  }
  
  public Object create(SerializationStreamReader reader) throws SerializationException {
    return org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean_FieldSerializer.instantiate(reader);
  }
  
  public void deserial(SerializationStreamReader reader, Object object) throws SerializationException {
    org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean_FieldSerializer.deserialize(reader, (org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean)object);
  }
  
  public void serial(SerializationStreamWriter writer, Object object) throws SerializationException {
    org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean_FieldSerializer.serialize(writer, (org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean)object);
  }
  
}
