List of usage examples for org.apache.commons.lang ArrayUtils isEmpty
public static boolean isEmpty(boolean[] array)
Checks if an array of primitive booleans is empty or null
.
From source file:com.etcc.csc.datatype.PaymentDetailUtil.java
public static Violation[] convertToStatementViolations(OLC_ST_VIOLATION_REC[] violationRecs) throws Exception { if (ArrayUtils.isEmpty(violationRecs)) { return null; }/*from w w w. j ava 2 s . c o m*/ Violation[] violations = new Violation[violationRecs.length]; for (int i = 0; i < violationRecs.length; i++) { violations[i] = convertToStatementViolation(violationRecs[i]); } return violations; }
From source file:com.etcc.csc.presentation.datatype.PaymentContext.java
public List<Invoice> getAuthorizedCollectionInvs() { List<Invoice> list = new ArrayList<Invoice>(); if (!ArrayUtils.isEmpty(collectionInvs)) { for (int i = 0; i < collectionInvs.length; i++) { if (collectionInvs[i].isAuthorized()) { list.add(collectionInvs[i]); }// w w w . j a v a 2 s. c o m } } return list; }
From source file:com.etcc.csc.presentation.datatype.PaymentContext.java
public boolean getOpenCollectionInvExists() { if (!ArrayUtils.isEmpty(collectionInvs)) { for (int i = 0; i < collectionInvs.length; i++) { if ("N".equals(collectionInvs[i].getPaidIndicator())) { return true; }// w w w.j a va2 s . c om } } return false; }
From source file:com.ning.maven.plugins.dependencyversionscheck.AbstractDependencyVersionsMojo.java
private void updateResolutionMapForDep(String[] visibleScopes, String[] transitiveScopes, SortedMap resolutionMap, Dependency dependency) throws InvalidDependencyVersionException, ProjectBuildingException, ArtifactResolutionException, ArtifactNotFoundException { LOG.debug("Checking direct dependency {}...", dependency); if (!isVisible(dependency.getScope(), visibleScopes)) { LOG.debug("... in invisible scope, ignoring!"); return;/* w ww. j av a 2s . com*/ } LOG.debug("... visible, resolving"); // Dependency is visible, now resolve it. final String artifactName = getQualifiedName(dependency); if (artifactName.length() > maxLen) { maxLen = artifactName.length(); } final Artifact resolvedArtifact = (Artifact) resolvedDependenciesByName.get(artifactName); if (resolvedArtifact == null) { // This is a potential problem because it should not be possible that a dependency that is required // by the project is not in the list of resolved dependencies. LOG.warn("No artifact available for '{}' (probably a multi-module child artifact).", artifactName); } else { final VersionResolution resolution = resolveVersion(dependency, resolvedArtifact, artifactName, true); addToResolutionMap(resolutionMap, resolution); if (!ArrayUtils.isEmpty(transitiveScopes)) { final ArtifactFilter scopeFilter = new ArtifactScopeFilter(transitiveScopes); // List of VersionResolution objects. List transitiveDependencies = null; try { transitiveDependencies = resolveTransitiveVersions(dependency, resolvedArtifact, artifactName, scopeFilter); } catch (MultipleArtifactsNotFoundException ex) { logArtifactResolutionException(ex); transitiveDependencies = resolveTransitiveVersions(dependency, ex.getResolvedArtifacts(), artifactName, scopeFilter); } catch (AbstractArtifactResolutionException ex) { logArtifactResolutionException(ex); } if (transitiveDependencies != null) { LOG.debug("Artifact {} contributes {}", artifactName, transitiveDependencies); for (Iterator transitiveIt = transitiveDependencies.iterator(); transitiveIt.hasNext();) { final VersionResolution versionResolution = (VersionResolution) transitiveIt.next(); addToResolutionMap(resolutionMap, versionResolution); } } } } }
From source file:com.dianping.wed.cache.redis.biz.WeddingRedisServiceImpl.java
@Override public List<String> hMGet(WeddingRedisKeyDTO redisKey, final String... fields) { if (ArrayUtils.isEmpty(fields)) { return new ArrayList<String>(); }// w w w .j ava 2 s . com final String finalKey = wcsWeddingRedisKeyCfgService.generateKey(redisKey); return JedisHelper.doJedisOperation(new JedisCallback<List<String>>() { @Override public List<String> doWithJedis(Jedis jedis) { return jedis.hmget(finalKey, fields); } }, finalKey, RedisActionType.READ); }
From source file:com.etcc.csc.presentation.datatype.PaymentContext.java
public BigDecimal getCollectionInvTotalUnPaidAmount() { BigDecimal amount = BigDecimal.ZERO; if (!ArrayUtils.isEmpty(collectionInvs)) { for (int i = 0; i < collectionInvs.length; i++) { if ("N".equals(collectionInvs[i].getPaidIndicator())) { amount = amount.add(collectionInvs[i].getAmount()); }//w w w.ja v a 2 s .c om } } return amount; }
From source file:com.etcc.csc.presentation.datatype.PaymentContext.java
public BigDecimal getCollectionInvTotalTollDue() { BigDecimal amount = BigDecimal.ZERO; if (!ArrayUtils.isEmpty(collectionInvs)) { for (int i = 0; i < collectionInvs.length; i++) { if ("N".equals(collectionInvs[i].getPaidIndicator())) { amount = amount.add(collectionInvs[i].getAmount()) .subtract(collectionInvs[i].getInvoiceAdminFee()) .subtract(collectionInvs[i].getAdjustedTxnFees()) .subtract(collectionInvs[i].getInvSecondNoticeAdminFee()); }//from w w w .j a va2 s. c om } } return amount; }
From source file:gov.nih.nci.cabig.caaers.grid.CaaersStudyConsumer.java
/** * Populates study organization and returns it. * /*from www. j a va 2 s . c om*/ * @param study * @param studyOrgTypes * @throws InvalidStudyException */ void populateStudyOrganizations(gov.nih.nci.cabig.caaers.domain.Study study, StudyOrganizationType[] studyOrgTypes) throws StudyCreationException, InvalidStudyException { if (ArrayUtils.isEmpty(studyOrgTypes)) { logger.error("No organization is associated to this study (gridId :" + study.getGridId() + ")"); StudyCreationException exp = new StudyCreationException(); exp.setFaultString("No organization is associated to this study"); exp.setFaultReason("No organization is associated to this study (gridId :" + study.getGridId() + ")"); throw exp; } List<StudyOrganization> studyOrgList = new ArrayList<StudyOrganization>(); boolean isPrimarySponsor = true; for (StudyOrganizationType studyOrgType : studyOrgTypes) { StudyOrganization studyOrganization = null; if (studyOrgType instanceof StudyFundingSponsorType) { StudyFundingSponsor fundingSponsor = new StudyFundingSponsor(); fundingSponsor.setPrimary(isPrimarySponsor); isPrimarySponsor = false; studyOrganization = fundingSponsor; } else if (studyOrgType instanceof StudyCoordinatingCenterType) { studyOrganization = new StudyCoordinatingCenter(); } else if (studyOrgType instanceof StudySiteType) { studyOrganization = new StudySite(); } else { logger.error("Unknown StudyOrganizationType in grid Study " + studyOrgType.toString()); throw getInvalidStudyException("Unknown StudyOrganizationType in grid Study "); } studyOrganization.setOrganization(fetchOrganization(studyOrgType.getHealthcareSite(0))); studyOrganization.setStudy(study); studyOrganization.setGridId(studyOrgType.getGridId()); // populate investigators populateInvestigators(studyOrganization, studyOrgType.getStudyInvestigator()); studyOrgList.add(studyOrganization); } // ~for study.setStudyOrganizations(studyOrgList); if (study.getStudyFundingSponsors() == null || study.getStudyFundingSponsors().size() == 0) { logger.error("No StudyFundingSponsor available in the input message"); throw getInvalidStudyException("No StudyFundingSponsor available in the input message"); } }
From source file:com.nec.harvest.service.impl.ActualViewServiceImpl.java
/** {@inheritDoc} */ @Override/*from w w w .j a va 2s .co m*/ public List<VJiseki> findByOrgCodesAndMonth(String month, String... orgCodes) throws ServiceException { if (StringUtils.isEmpty(month)) { throw new IllegalArgumentException("Can not find actual view objects with month empty"); } if (ArrayUtils.isEmpty(orgCodes)) { throw new IllegalArgumentException("Can not find actual view objects with organization codes null"); } final Session session = HibernateSessionManager.getSession(); Transaction tx = null; List<VJiseki> jisekis = new ArrayList<>(); try { tx = session.beginTransaction(); Query query = repository.getSQLQuery(session, " SELECT StrCode as strCode, UriSkKG as uriSkKG, KtSkKG as ktSkKG, IdoSkKGU as idoSkKGU, IdoSkKGH as idoSkKGH, UriKrKG as uriKrKG, " + " KtKrKG as ktKrKG, KnSrKG as knSrKG, KtSrKG as ktSrKG, " + " KgcSrKG as kgcSrKG, IdoSrKGU as idoSrKGU, IdoSrKGH as idoSrKGH, " + " KtJkKG as ktJkKG, JkJkKG as jkJkKG, KgcJkKG as kgcJkKG, " + " IdoJkKGU as idoJkKGU, IdoJkKGH as idoJkKGH, HelpJkKGU as helpJkKGU, HelpJkKGH as helpJkKGH, " + " KtKhKG as ktKhKG, KnKhKG as knKhKG, KgcKhKG as kgcKhKG, " + " IdoKhKGU as idoKhKGU, IdoKhKGH as idoKhKGH, UriKhKG as uriKhKG " + " FROM V_JISEKI WHERE StrCode IN (:orgCodes) AND Getsudo = :month"); query.setParameterList("orgCodes", orgCodes); query.setString("month", month); query.setResultTransformer(Transformers.aliasToBean(VJiseki.class)); // jisekis = repository.findByQuery(query); // Release transaction tx.commit(); if (CollectionUtils.isEmpty(jisekis)) { throw new ObjectNotFoundException("No jisekis (actual view object) found"); } } catch (SQLGrammarException | GenericJDBCException ex) { if (tx != null) { tx.rollback(); } throw new ServiceException( "An exception occur when get a list of actual view objects of multi organization and month", ex); } finally { HibernateSessionManager.closeSession(session); } return jisekis; }
From source file:com.etcc.csc.presentation.datatype.PaymentContext.java
public BigDecimal getCollectionInvTotalTXNAdminFee() { BigDecimal amount = BigDecimal.ZERO; if (!ArrayUtils.isEmpty(collectionInvs)) { for (int i = 0; i < collectionInvs.length; i++) { if ("N".equals(collectionInvs[i].getPaidIndicator())) { amount = amount.add(BigDecimalUtil.nullSafe(collectionInvs[i].getAdjustedTxnFees())); }// www .j a va 2s. c o m } } return amount; }