use of java.util.AbstractList in project j2objc by google.
the class AbstractListTest method test_indexOfLjava_lang_Object.
public void test_indexOfLjava_lang_Object() {
AbstractList al = new ArrayList();
al.add(0);
al.add(1);
al.add(2);
al.add(3);
al.add(4);
assertEquals(-1, al.indexOf(5));
assertEquals(2, al.indexOf(2));
}
use of java.util.AbstractList in project dagger by square.
the class InjectionTest method noProvideBindingsForAbstractClasses.
@Test
public void noProvideBindingsForAbstractClasses() {
class TestEntryPoint {
@Inject
AbstractList abstractList;
}
@Module(injects = TestEntryPoint.class)
class TestModule {
}
ObjectGraph graph = ObjectGraph.createWith(new TestingLoader(), new TestModule());
try {
graph.validate();
fail();
} catch (IllegalStateException expected) {
}
}
use of java.util.AbstractList in project records-management by Alfresco.
the class UnfiledRecordFolderChildrenRelation method readAll.
@Override
@WebApiDescription(title = "Return a paged list of unfiled container children for the container identified by 'unfiledContainerId'")
public CollectionWithPagingInfo<UnfiledRecordFolderChild> readAll(String unfileRecordFolderId, Parameters parameters) {
checkNotBlank("unfileRecordFolderId", unfileRecordFolderId);
mandatory("parameters", parameters);
String relativePath = parameters.getParameter(Nodes.PARAM_RELATIVE_PATH);
NodeRef parentNodeRef = apiUtils.lookupAndValidateNodeType(unfileRecordFolderId, RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER, relativePath, true);
// list unfiled record folders and records
Set<QName> searchTypeQNames = searchTypesFactory.buildSearchTypesForUnfiledEndpoint(parameters, LIST_UNFILED_RECORD_FOLDER_CHILDREN_EQUALS_QUERY_PROPERTIES);
final PagingResults<FileInfo> pagingResults = fileFolderService.list(parentNodeRef, null, searchTypeQNames, null, apiUtils.getSortProperties(parameters), null, Util.getPagingRequest(parameters.getPaging()));
final List<FileInfo> page = pagingResults.getPage();
Map<String, UserInfo> mapUserInfo = new HashMap<>();
List<UnfiledRecordFolderChild> nodes = new AbstractList<UnfiledRecordFolderChild>() {
@Override
public UnfiledRecordFolderChild get(int index) {
FileInfo info = page.get(index);
return nodesModelFactory.createUnfiledRecordFolderChild(info, parameters, mapUserInfo, true);
}
@Override
public int size() {
return page.size();
}
};
UnfiledRecordFolder sourceEntity = null;
if (parameters.includeSource()) {
FileInfo info = fileFolderService.getFileInfo(parentNodeRef);
sourceEntity = nodesModelFactory.createUnfiledRecordFolder(info, parameters, mapUserInfo, true);
}
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), nodes, pagingResults.hasMoreItems(), pagingResults.getTotalResultCount().getFirst(), sourceEntity);
}
use of java.util.AbstractList in project records-management by Alfresco.
the class RecordFolderChildrenRelation method readAll.
@Override
@WebApiDescription(title = "Return a paged list of records for the record folder identified by 'recordFolderId'")
public CollectionWithPagingInfo<Record> readAll(String recordFolderId, Parameters parameters) {
checkNotBlank("recordFolderId", recordFolderId);
mandatory("parameters", parameters);
NodeRef parentNodeRef = apiUtils.lookupAndValidateNodeType(recordFolderId, RecordsManagementModel.TYPE_RECORD_FOLDER);
// list record folders
// FIXME searchParam
Set<QName> searchTypeQNames = searchTypesFactory.buildSearchTypesForUnfiledEndpoint(parameters, null);
final PagingResults<FileInfo> pagingResults = fileFolderService.list(parentNodeRef, null, searchTypeQNames, null, apiUtils.getSortProperties(parameters), null, Util.getPagingRequest(parameters.getPaging()));
final List<FileInfo> page = pagingResults.getPage();
Map<String, UserInfo> mapUserInfo = new HashMap<>();
List<Record> nodes = new AbstractList<Record>() {
@Override
public Record get(int index) {
FileInfo info = page.get(index);
return nodesModelFactory.createRecord(info, parameters, mapUserInfo, true);
}
@Override
public int size() {
return page.size();
}
};
RecordFolder sourceEntity = null;
if (parameters.includeSource()) {
FileInfo info = fileFolderService.getFileInfo(parentNodeRef);
sourceEntity = nodesModelFactory.createRecordFolder(info, parameters, mapUserInfo, true);
}
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), nodes, pagingResults.hasMoreItems(), pagingResults.getTotalResultCount().getFirst(), sourceEntity);
}
use of java.util.AbstractList in project records-management by Alfresco.
the class FilePlanChildrenRelation method readAll.
@Override
@WebApiDescription(title = "Return a paged list of file plan children (record categories) for the container identified by 'filePlanId'")
public CollectionWithPagingInfo<RecordCategory> readAll(String filePlanId, Parameters parameters) {
// validate parameters
checkNotBlank("filePlanId", filePlanId);
mandatory("parameters", parameters);
QName filePlanType = apiUtils.getFilePlanType();
if (// rm site not created
filePlanType == null) {
throw new EntityNotFoundException(filePlanId);
}
NodeRef parentNodeRef = apiUtils.lookupAndValidateNodeType(filePlanId, filePlanType);
// list record categories
Set<QName> searchTypeQNames = searchTypesFactory.buildSearchTypesForFilePlanEndpoint();
// FIXME this param null
List<FilterProp> filterProps = apiUtils.getListChildrenFilterProps(parameters, null);
final PagingResults<FileInfo> pagingResults = fileFolderService.list(parentNodeRef, null, searchTypeQNames, null, apiUtils.getSortProperties(parameters), filterProps, Util.getPagingRequest(parameters.getPaging()));
final List<FileInfo> page = pagingResults.getPage();
Map<String, UserInfo> mapUserInfo = new HashMap<>();
List<RecordCategory> nodes = new AbstractList<RecordCategory>() {
@Override
public RecordCategory get(int index) {
FileInfo info = page.get(index);
return nodesModelFactory.createRecordCategory(info, parameters, mapUserInfo, true);
}
@Override
public int size() {
return page.size();
}
};
FilePlan sourceEntity = null;
if (parameters.includeSource()) {
FileInfo info = fileFolderService.getFileInfo(parentNodeRef);
sourceEntity = nodesModelFactory.createFilePlan(info, parameters, mapUserInfo, true);
}
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), nodes, pagingResults.hasMoreItems(), pagingResults.getTotalResultCount().getFirst(), sourceEntity);
}
Aggregations