Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.uberfire.rpc.impl;
 
 import  org.jboss.errai.marshalling.client.api.MarshallingSession;
 import  org.jboss.errai.marshalling.client.api.annotations.ClientMarshaller;
 import  org.jboss.errai.marshalling.client.api.annotations.ServerMarshaller;
 import  org.jboss.errai.marshalling.client.api.json.EJValue;
 import  org.jboss.errai.marshalling.client.marshallers.AbstractNullableMarshaller;
import  org.uberfire.security.impl.IdentityImpl;
@ClientMarshaller(SessionInfo.class)
@ServerMarshaller(SessionInfo.class)
public class SessionInfoMarshalller extends AbstractNullableMarshaller<SessionInfo> {
    @Override
    public SessionInfo doNotNullDemarshallfinal EJValue ejValue,
                                            final MarshallingSession marshallingSession ) {
        return new SessionInfoImplejValue.isObject().get( "id" ).isString().stringValue(),
                                    new IdentityImpl( ejValue.isObject().get( "identityId" ).isString().stringValue() ) );
    }
    @Override
    public String doNotNullMarshallfinal SessionInfo sessionInfo,
                                     final MarshallingSession marshallingSession ) {
        return "{\"" + . + "\":\"" + SessionInfo.class.getName() + "\"," +
                "\"" + . + "\":\"" + sessionInfo.hashCode() + "\"," +
                "\"" + "id" + "\":\"" + sessionInfo.getId() + "\"," +
                "\"" + "identityId" + "\":\"" + sessionInfo.getIdentity().getName() + "\"}";
    }
    @Override
    public SessionInfo[] getEmptyArray() {
        return new SessionInfo[ 0 ];
    }
New to GrepCode? Check out our FAQ X