@Test public void serializeDeserializeTaskTest() throws Exception { Task task = new Task(UUID.randomUUID().toString(), "task", System.currentTimeMillis(), "payload"); Object serializedTask = PostgresUtil.objectToJsonBParameter(task, null); Task deserializedTask = PostgresUtil.fromJsonB(((PGobject) serializedTask).getValue(), Task.class); Assert.assertEquals(task, deserializedTask); }
@Override public String toString() { return "Task{" + "id=" + id + ", name='" + name + '\'' + ", executionTime=" + executionTime + ", payload='" + payload + '\'' + '}'; }
Task { @Override public String toString() { return "Task{" + "id=" + id + ", name='" + name + '\'' + ", executionTime=" + executionTime + ", payload='" + payload + '\'' + '}'; } }
Task { @Override public String toString() { return "Task{" + "id=" + id + ", name='" + name + '\'' + ", executionTime=" + executionTime + ", payload='" + payload + '\'' + '}'; } Task(
            String id,
            String name,
            long executionTime,
            String payload); private  Task(); }
Task { @Override public String toString() { return "Task{" + "id=" + id + ", name='" + name + '\'' + ", executionTime=" + executionTime + ", payload='" + payload + '\'' + '}'; } Task(
            String id,
            String name,
            long executionTime,
            String payload); private  Task(); final String getId(); final String getName(); final long getExecutionTime(); void setExecutionTime(long executionTime); final String getPayload(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
Task { @Override public String toString() { return "Task{" + "id=" + id + ", name='" + name + '\'' + ", executionTime=" + executionTime + ", payload='" + payload + '\'' + '}'; } Task(
            String id,
            String name,
            long executionTime,
            String payload); private  Task(); final String getId(); final String getName(); final long getExecutionTime(); void setExecutionTime(long executionTime); final String getPayload(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }