public static String getSerializedVectorClock ( VectorClock vc ) { VectorClockWrapper vcWrapper = new VectorClockWrapper ( vc ) ; String serializedVC = "" ; try { serializedVC = mapper . writeValueAsString ( vcWrapper ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return serializedVC ; }
Function to serialize the given Vector clock into a string . If something goes wrong it returns an empty string .