List of usage examples for java.util Collections EMPTY_LIST
List EMPTY_LIST
To view the source code for java.util Collections EMPTY_LIST.
Click Source Link
From source file:de.betterform.xml.xforms.ui.RepeatItem.java
public List getNodeset() { List repeatNodeset = repeat.getNodeset(); int localPosition = getPosition(); return repeatNodeset.size() >= localPosition ? Collections.singletonList(repeatNodeset.get(localPosition - 1)) : Collections.EMPTY_LIST; }
From source file:net.sourceforge.fenixedu.presentationTier.Action.operator.OperatorValidatePartyContactsDA.java
@Atomic private void sendPhysicalAddressValidationEmail(PhysicalAddressValidation physicalAddressValidation) { final Person person = (Person) physicalAddressValidation.getPartyContact().getParty(); final String subject = BundleUtil.getString(Bundle.MANAGER, "label.contacts.validation.operator.email.subject", Unit.getInstitutionAcronym()); final String state = StringUtils.uncapitalize(physicalAddressValidation.getState().getPresentationName()); String body = BundleUtil.getString(Bundle.MANAGER, "label.contacts.validation.operator.email.body", physicalAddressValidation.getPartyContact().getPresentationValue(), state); final String description = physicalAddressValidation.getDescription(); if (!StringUtils.isEmpty(description)) { body += "\n" + description; }//ww w. ja v a2 s . c om final String sendingEmail = person.getEmailForSendingEmails(); if (!StringUtils.isEmpty(sendingEmail)) { new Message(Bennu.getInstance().getSystemSender(), Collections.EMPTY_LIST, Collections.EMPTY_LIST, subject, body, sendingEmail); } }
From source file:io.druid.query.lookup.LookupSnapshotTakerTest.java
@Test public void testLookupPullingFromNonExistingFile() throws IOException { File directory = temporaryFolder.newFolder(); LookupSnapshotTaker lookupSnapshotTaker = new LookupSnapshotTaker(mapper, directory.getAbsolutePath()); List<LookupBean> actualList = lookupSnapshotTaker.pullExistingSnapshot(); Assert.assertEquals(Collections.EMPTY_LIST, actualList); }
From source file:io.qdb.server.controller.InputController.java
@SuppressWarnings("unchecked") @Override// www.jav a 2 s .c o m protected void list(Call call, int offset, int limit) throws IOException { List<InputDTO> ans = new ArrayList<InputDTO>(); Queue q = call.getQueue(); Map<String, String> inputs = q.getInputs(); if (inputs != null) { for (Map.Entry<String, String> e : inputs.entrySet()) { Input in = repo.findInput(e.getValue()); if (in != null) ans.add(createInputDTO(call, e.getKey(), in)); } Collections.sort(ans); int last = Math.min(offset + limit, ans.size()); if (offset > 0 || last < ans.size()) { if (offset >= ans.size()) ans = Collections.EMPTY_LIST; else ans = ans.subList(offset, last); } } call.setJson(ans); }
From source file:com.bloatit.framework.webprocessor.url.UrlParameter.java
@Override @SuppressWarnings("unchecked") public Iterator<UrlNode> iterator() { return Collections.EMPTY_LIST.iterator(); }
From source file:net.rim.ejde.internal.ui.launchers.LaunchUtils.java
/** * Get the projects defined in the given launch configuration. * * @param configuration//w w w.j a v a 2 s . c om * The launch configuration * @return The collection of projects */ @SuppressWarnings("unchecked") public static Set<IProject> getProjectsFromConfiguration(ILaunchConfiguration configuration) { List<String> checkedProjectNames; try { checkedProjectNames = configuration.getAttribute(IFledgeLaunchConstants.ATTR_DEPLOYED_PROJECTS, Collections.EMPTY_LIST); } catch (CoreException e) { _logger.error(e); return Collections.emptySet(); } Set<IProject> checkedProjects = new HashSet<IProject>(); for (String name : checkedProjectNames) { IResource ires = ResourcesPlugin.getWorkspace().getRoot().findMember(name); if (ires != null && ires instanceof IProject) { IProject project = (IProject) ires; // this also filters out closed projects if (project.isOpen()) { checkedProjects.add(project); } } } return checkedProjects; }
From source file:de.hybris.platform.commercefacades.voucher.impl.DefaultVoucherFacade.java
@Override public List<VoucherData> getVouchersForCart() { final List<VoucherData> vouchersData = new ArrayList<VoucherData>(); final CartModel cartModel = getCartService().getSessionCart(); if (cartModel != null) { final Collection<String> voucherCodes = getVoucherService().getAppliedVoucherCodes(cartModel); for (final String code : voucherCodes) { try { vouchersData.add(getSingleVouchersByCode(code)); } catch (VoucherOperationException e) { // nothing }// w ww .j a va 2 s . c o m } return vouchersData; } return Collections.EMPTY_LIST; }
From source file:com.streamsets.pipeline.stage.processor.xmlflattener.TestXMLFlatteningProcessor.java
@Test public void testSingleRecordAttrsNoNS() throws Exception { String xml = getXML(""); Record expected = RecordCreator.create(); expected.set(Field.create(createExpectedRecord("", "", "", ".", "#", "", true, false))); doTest(xml, "contact", ImmutableList.of(expected), Collections.EMPTY_LIST, OnRecordError.DISCARD, false, true, false, false);//w ww . j a v a2s . c om }
From source file:cz.zcu.kiv.eegdatabase.wui.ui.experiments.forms.wizard.AddExperimentEnvironmentForm.java
private void addHardware() { ChoiceRenderer<Hardware> renderer = new ChoiceRenderer<Hardware>("title", "hardwareId"); LoadableListModel<Hardware> choiceModel = new LoadableListModel<Hardware>() { private static final long serialVersionUID = 1L; @Override/*from w w w . ja v a 2s .c o m*/ protected List<Hardware> load() { Experiment experiment2 = model.getObject(); ResearchGroup researchGroup = experiment2.getResearchGroup(); if (researchGroup != null) return hardwareFacade.getRecordsByGroup(researchGroup.getResearchGroupId()); else return Collections.EMPTY_LIST; } }; ListMultipleChoice<Hardware> hardwareChoice = new ListMultipleChoice<Hardware>("hardwares", new PropertyModel<List<Hardware>>(model.getObject(), "hardwares"), choiceModel, renderer); hardwareChoice.setMaxRows(SELECT_ROWS); hardwareChoice.setLabel(ResourceUtils.getModel("label.hardware")); hardwareChoice.setRequired(true); final FeedbackPanel feedback = createFeedbackForComponent(hardwareChoice, "hardwareFeedback"); add(hardwareChoice); add(feedback); }
From source file:TreeNode.java
/** * Return an Iterator over all children of this node that have the * specified name. If there are no such children, an empty Iterator * is returned.//from w w w . j a v a2s. c o m * * @param name Name used to select children */ public Iterator findChildren(String name) { if (children == null) return (Collections.EMPTY_LIST.iterator()); ArrayList results = new ArrayList(); Iterator items = children.iterator(); while (items.hasNext()) { TreeNode item = (TreeNode) items.next(); if (name.equals(item.getName())) results.add(item); } return (results.iterator()); }