use of com.linkedin.restli.examples.defaults.api.LowLevelRecordWithDefault in project rest.li by linkedin.
the class FieldFillInDefaultResources method getAllHighLevelRecordWithDefault.
@RestMethod.GetAll
public CollectionResult<HighLevelRecordWithDefault, LowLevelRecordWithDefault> getAllHighLevelRecordWithDefault(@PagingContextParam PagingContext pagingContext) {
final int total = 3;
List<HighLevelRecordWithDefault> elements = new LinkedList<>();
for (int i = 0; i < total; i++) {
elements.add(new HighLevelRecordWithDefault().setNoDefaultFieldA(i));
}
LowLevelRecordWithDefault metadata = new LowLevelRecordWithDefault();
return new CollectionResult<>(elements, total, metadata);
}
use of com.linkedin.restli.examples.defaults.api.LowLevelRecordWithDefault in project rest.li by linkedin.
the class TestFillInDefaultValue method testGetAllData.
@DataProvider(name = "testGetAllData")
private Object[][] testGetAllData() throws CloneNotSupportedException {
final int count = 3;
List<HighLevelRecordWithDefault> elements = new ArrayList<>();
for (int i = 0; i < count; i++) {
elements.add(new HighLevelRecordWithDefault(expectedTestData.clone()).setNoDefaultFieldA(i));
}
CollectionMetadata collectionMetadata = new CollectionMetadata().setCount(10).setTotal(3).setStart(0).setLinks(new LinkArray());
LowLevelRecordWithDefault metadata = new LowLevelRecordWithDefault();
metadata.setNameWithDefault(metadata.getNameWithDefault());
return new Object[][] { { elements, collectionMetadata, metadata } };
}
use of com.linkedin.restli.examples.defaults.api.LowLevelRecordWithDefault in project rest.li by linkedin.
the class TestFillInDefaultValue method testFinderData.
@DataProvider(name = "testFinderData")
private Object[][] testFinderData() throws CloneNotSupportedException {
final int total = 3;
List<HighLevelRecordWithDefault> elements = new ArrayList<>();
for (int i = 0; i < total; i++) {
elements.add(new HighLevelRecordWithDefault(expectedTestData.clone()).setNoDefaultFieldA(2));
}
CollectionMetadata collectionMetadata = new CollectionMetadata().setLinks(new LinkArray()).setCount(10).setTotal(3).setStart(0);
LowLevelRecordWithDefault metadata = new LowLevelRecordWithDefault();
metadata.setNameWithDefault(metadata.getNameWithDefault());
return new Object[][] { { 2, elements, collectionMetadata, metadata } };
}
use of com.linkedin.restli.examples.defaults.api.LowLevelRecordWithDefault in project rest.li by linkedin.
the class TestFillInDefaultValue method testGetAllDataWithoutRequireDefault.
@DataProvider(name = "testGetAllDataWithoutRequireDefault")
private Object[][] testGetAllDataWithoutRequireDefault() throws CloneNotSupportedException {
final int count = 3;
List<HighLevelRecordWithDefault> elements = new ArrayList<>();
for (int i = 0; i < count; i++) {
elements.add(new HighLevelRecordWithDefault().setNoDefaultFieldA(i));
}
CollectionMetadata collectionMetadata = new CollectionMetadata().setLinks(new LinkArray()).setCount(10).setStart(0).setTotal(3);
LowLevelRecordWithDefault metadata = new LowLevelRecordWithDefault();
return new Object[][] { { elements, collectionMetadata, metadata } };
}
use of com.linkedin.restli.examples.defaults.api.LowLevelRecordWithDefault in project rest.li by linkedin.
the class FieldFillInDefaultResources method findRecords.
@Finder("findRecords")
public CollectionResult<HighLevelRecordWithDefault, LowLevelRecordWithDefault> findRecords(@QueryParam("noDefaultFieldA") Integer fieldA) {
final int total = 3;
List<HighLevelRecordWithDefault> elements = new ArrayList<>();
for (int i = 0; i < total; i++) {
HighLevelRecordWithDefault record = new HighLevelRecordWithDefault().setNoDefaultFieldA(fieldA);
elements.add(record);
}
LowLevelRecordWithDefault metadata = new LowLevelRecordWithDefault();
return new CollectionResult<>(elements, total, metadata);
}
Aggregations