Package com.linkedin.restli.examples.custom.types

Examples of com.linkedin.restli.examples.custom.types.CustomNonNegativeLong


  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestChainedTyperefsBuilderDataProvider")
  public void testBatchUpdateForChainedRefs(RootBuilderWrapper<CompoundKey, Greeting> builders) throws RemoteInvocationException
  {
    Long lo = 29L;
    Long date = 10L;
    ChainedTyperefsBuilders.Key key = new ChainedTyperefsBuilders.Key().setAge(new CustomNonNegativeLong(lo)).setBirthday(new Date(date));

    RequestBuilder<? extends Request<BatchKVResponse<CompoundKey, UpdateStatus>>> batchUpdateRequest = builders.batchUpdate().input(key, new Greeting().setId(1).setMessage("foo")).getBuilder();
    BatchKVResponse<CompoundKey, UpdateStatus> response = REST_CLIENT.sendRequest(batchUpdateRequest).getResponse().getEntity();

    Assert.assertEquals(1, response.getResults().keySet().size());
    CompoundKey expected = new CompoundKey();
    expected.append("birthday", new Date(date));
    expected.append("age", new CustomNonNegativeLong(lo));
    CompoundKey result = response.getResults().keySet().iterator().next();
    Assert.assertEquals(result, expected);
  }
View Full Code Here


{

  @Override
  public Greeting get(CompoundKey key)
  {
    CustomNonNegativeLong age = (CustomNonNegativeLong)key.getPart("age");
    Date birthday = (Date)key.getPart("birthday");

    return new Greeting().setId(age.toLong() + birthday.getTime());
  }
View Full Code Here

  }

  @Action(name = "CustomNonNegativeLongRef", returnTyperef=CustomNonNegativeLongRef.class)
  public CustomNonNegativeLong CustomNonNegativeLong(@ActionParam(value="arg1", typeref=CustomNonNegativeLongRef.class) CustomNonNegativeLong arg1)
  {
    return new CustomNonNegativeLong(0L);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.restli.examples.custom.types.CustomNonNegativeLong

Copyright © 2018 www.massapicom. 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.