org.glassfish.jersey.examples.httppatch
Class PatchableResource

java.lang.Object
  extended by org.glassfish.jersey.examples.httppatch.PatchableResource

@Path(value="patchable-state")
@Produces(value="application/json")
public class PatchableResource
extends Object

Patchable resource.

Author:
Gerard Davison (gerard.davison at oracle.com), Marek Potociar (marek.potociar at oracle.com)

Constructor Summary
PatchableResource()
           
 
Method Summary
 State getState()
          Get current resource state.
 State patchState(State newState)
          Set new resource state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatchableResource

public PatchableResource()
Method Detail

getState

@GET
@Consumes(value="application/json")
public State getState()
Get current resource state.

Returns:
current resource state.

patchState

@PATCH
@Consumes(value="application/json-patch+json")
public State patchState(State newState)
Set new resource state.

We only need to replace the resource state with the one passed into the method as the actual state patching occurred in the PatchingInterceptor.

Parameters:
newState - new resource state.
Returns:
patched state.


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.