Examples of toJson()


Examples of com.google.collide.dtogen.server.TestDtoServerImpls.ComplicatedDtoImpl.toJson()

    dtoImpl.setIntId(1);
    dtoImpl.setSimpleEnum(null);

    // Make it json and pull it back out.
    Gson gson = new GsonBuilder().serializeNulls().create();
    String serialized = dtoImpl.toJson();
    assertEquals(dtoToJson(gson, dtoImpl), serialized);

    ComplicatedDto dto = ComplicatedDtoImpl.fromJsonString(serialized);
    assertEquals(1, dto.getIntId());
    assertNull(dto.getSimpleEnum());
View Full Code Here

Examples of com.google.collide.dtogen.server.TestDtoServerImpls.SimpleDtoImpl.toJson()

    checkSimpleDto(dtoImpl, fooString, intValue);

    // Make it json and pull it back out.
    Gson gson = new GsonBuilder().serializeNulls().create();
    String serialized = dtoImpl.toJson();
    assertEquals(dtoToJson(gson, dtoImpl), serialized);
    SimpleDto dto = SimpleDtoImpl.fromJsonString(serialized);

    checkSimpleDto(dto, fooString, intValue);
  }
View Full Code Here

Examples of com.google.collide.dtogen.server.TestDtoServerImpls.SimpleDtoSubTypeImpl.toJson()

    final String valueForFieldOnSupertype = "valueForFieldOnSupertype";
    final String valueForFieldOnSelf = "valueForFieldOnSelf";
    SimpleDtoSubTypeImpl dto = SimpleDtoSubTypeImpl.make();
    dto.setName(valueForFieldOnSupertype);
    dto.setAnotherField(valueForFieldOnSelf);
    String json = dto.toJson();

    assertTrue(json.contains(valueForFieldOnSelf));
    assertTrue(json.contains(valueForFieldOnSupertype));
  }
View Full Code Here

Examples of com.google.gwt.query.client.IsProperties.toJson()

    assertEquals("1", p1.get("a"));
    assertEquals(Double.valueOf(1), p1.get("b"));
    assertEquals("null", p1.get("c"));
    assertNull(p1.get("d"));

    p1 = GQ.create(p1.toJson());

    assertEquals("1", p1.get("a"));
    assertEquals(Double.valueOf(1), p1.get("b"));
    assertEquals("null", p1.get("c"));
    assertNull(p1.get("d"));
View Full Code Here

Examples of com.hazelcast.monitor.TimedMemberState.toJson()

                final OutputStreamWriter writer = new OutputStreamWriter(outputStream, "UTF-8");
                try {
                    JsonObject root = new JsonObject();
                    root.add("identifier", identifier.toJson());
                    TimedMemberState timedMemberState = timedMemberStateFactory.createTimedMemberState();
                    root.add("timedMemberState", timedMemberState.toJson());
                    root.writeTo(writer);
                    writer.flush();
                    outputStream.flush();
                    post(connection);
                } finally {
View Full Code Here

Examples of com.ibm.sbt.services.client.smartcloud.bss.UserCredentialJsonBuilder.toJson()

  public void setOneTimePassword(String loginName, String password) throws BssException, JsonException, IOException {
    UserCredentialJsonBuilder userCredential = new UserCredentialJsonBuilder();
    userCredential.setLoginName(loginName)
            .setNewPassword(password);
   
    System.out.println("Set one-time password: " + userCredential.toJson());
   
    AuthenticationService authenticationService = getAuthenticationService();
    authenticationService.setOneTimePassword(userCredential);
  }
   
View Full Code Here

Examples of com.intersys.gds.Document.toJSON()

    void load() {
        long start = getTime();
        for (int i=0;i<documentCount;i++) {
            Document customer = customers.load(Integer.toString(i));
            if (i == 2) {
                System.out.println(customer.toJSON("\r\n"));
            }
        }
        reportLoad(documentCount*2,start);
    }

View Full Code Here

Examples of com.intersys.gds.noschema.NoSchemaDocument.toJSON()

    void load() {
        long start = getTime();
        for (int i=0;i<documentCount;i++) {
            NoSchemaDocument customer = customers.load(""+i,customersData.get(0));
            if (i == 2) {
                System.out.println(customer.toJSON("\r\n"));
            }
        }
        reportQuery(documentCount,start);
    }
View Full Code Here

Examples of com.jayway.jsonpath.internal.spi.json.JacksonJsonProvider.toJson()

            res = compiled.read(json, Object.class);
        } catch (Exception e) {
            error = getError(e);
        } finally {
            time = System.currentTimeMillis() - now;
            result = res != null ? jacksonProvider.toJson(res) : null;
            return new Result("nebhale", time, result, error);
        }
    }

    public Map<String, Result> runAll() {
View Full Code Here

Examples of com.jayway.jsonpath.spi.JsonProvider.toJson()

            Collection<String> keys = jsonProvider.getPropertyKeys(obj);
            if(!keys.contains(condition) && split.length == 1){

                if(configuration.getOptions().contains(Option.THROW_ON_MISSING_PROPERTY)){
                    throw new PathNotFoundException("Path '" + condition + "' not found in the current context:\n" + jsonProvider.toJson(obj));
                }

                if(pathToken.isEndToken()){
                    return null;
                } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.