Search in sources :

Example 16 with HighLevelRecordWithDefault

use of com.linkedin.restli.examples.defaults.api.HighLevelRecordWithDefault 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);
}
Also used : CollectionResult(com.linkedin.restli.server.CollectionResult) ArrayList(java.util.ArrayList) LowLevelRecordWithDefault(com.linkedin.restli.examples.defaults.api.LowLevelRecordWithDefault) HighLevelRecordWithDefault(com.linkedin.restli.examples.defaults.api.HighLevelRecordWithDefault) Finder(com.linkedin.restli.server.annotations.Finder) BatchFinder(com.linkedin.restli.server.annotations.BatchFinder)

Aggregations

HighLevelRecordWithDefault (com.linkedin.restli.examples.defaults.api.HighLevelRecordWithDefault)16 FillInDefaultsRequestBuilders (com.linkedin.restli.examples.defaults.api.FillInDefaultsRequestBuilders)8 Test (org.testng.annotations.Test)8 DataProvider (org.testng.annotations.DataProvider)6 LowLevelRecordWithDefault (com.linkedin.restli.examples.defaults.api.LowLevelRecordWithDefault)5 ArrayList (java.util.ArrayList)4 CollectionMetadata (com.linkedin.restli.common.CollectionMetadata)3 LinkArray (com.linkedin.restli.common.LinkArray)3 DataMap (com.linkedin.data.DataMap)2 FillInDefaultsGetRequestBuilder (com.linkedin.restli.examples.defaults.api.FillInDefaultsGetRequestBuilder)2 RecordCriteria (com.linkedin.restli.examples.defaults.api.RecordCriteria)2 CollectionResult (com.linkedin.restli.server.CollectionResult)2 BatchFinderCriteriaResult (com.linkedin.restli.common.BatchFinderCriteriaResult)1 EntityResponse (com.linkedin.restli.common.EntityResponse)1 BatchFinder (com.linkedin.restli.server.annotations.BatchFinder)1 Finder (com.linkedin.restli.server.annotations.Finder)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1