List of usage examples for java.lang Short valueOf
@HotSpotIntrinsicCandidate public static Short valueOf(short s)
From source file:com.ning.metrics.goodwill.access.GoodwillSchema.java
/** * Get the schema as a collection of fields. * We guarantee the ordering by field id. * * @return the sorted collection of fields *//*from w ww . j ava 2s .c o m*/ public ArrayList<GoodwillSchemaField> getSchema() { final ArrayList<GoodwillSchemaField> items = new ArrayList<GoodwillSchemaField>(thriftItems.values()); Collections.sort(items, new Comparator<GoodwillSchemaField>() { @Override public int compare(final GoodwillSchemaField left, final GoodwillSchemaField right) { return Short.valueOf(left.getId()).compareTo(right.getId()); } }); return items; }
From source file:com.github.javaclub.toolbox.util.javabean.JavaTypeHandlers.java
public Object getValue(String fieldValue) { return Short.valueOf(fieldValue); }
From source file:org.mifos.customers.checklist.business.CheckListBO.java
protected void update(String checkListName, Short checkListStatus, List<String> details, Short localeId, Short userId) throws CheckListException { setUpdateDetails(userId);/* w w w .ja v a 2 s . c o m*/ if (details == null || details.size() <= 0) { throw new CheckListException(CheckListConstants.CHECKLIST_CREATION_EXCEPTION); } if (StringUtils.isBlank(checkListName)) { throw new CheckListException(CheckListConstants.CHECKLIST_CREATION_EXCEPTION); } this.checklistName = checkListName; getChecklistDetails().clear(); for (String detail : details) { CheckListDetailEntity checkListDetailEntity = new CheckListDetailEntity(detail, Short.valueOf("1"), this, localeId); getChecklistDetails().add(checkListDetailEntity); } this.checklistStatus = checkListStatus; this.supportedLocales = localeId; }
From source file:org.mifos.accounts.fees.struts.actionforms.FeeActionForm.java
public FeePayment getFeePaymentTypeValue() throws PropertyNotFoundException { return StringUtils.isNotBlank(getFeePaymentType()) ? FeePayment.getFeePayment(Short.valueOf(getFeePaymentType())) : null;/* w w w . ja v a 2s . co m*/ }
From source file:com.zimbra.cs.volume.VolumeCLI.java
private void setCurrentVolume() throws ParseException, SoapFaultException, IOException, ServiceException { if (id == null) { throw new ParseException("id is missing"); }// w w w . j a v a2s.c om auth(auth); GetVolumeResponse resp = JaxbUtil.elementToJaxb(getTransport() .invokeWithoutSession(JaxbUtil.jaxbToElement(new GetVolumeRequest(Short.valueOf(id))))); VolumeInfo vol = resp.getVolume(); SetCurrentVolumeRequest req = new SetCurrentVolumeRequest(vol.getId(), vol.getType()); getTransport().invokeWithoutSession(JaxbUtil.jaxbToElement(req)); System.out.println("Volume " + id + " is now the current " + toTypeName(vol.getType()) + " volume."); }
From source file:org.mifos.application.meeting.struts.actionforms.MeetingActionForm.java
public RankOfDay getMonthRankValue() { return StringUtils.isNotBlank(getMonthRank()) ? RankOfDay.getRankOfDay(Short.valueOf(getMonthRank())) : null; }
From source file:org.apigw.monitoring.config.JmsConfig.java
@Bean public RedeliveryPolicy redeliveryPolicy() { RedeliveryPolicy policy = new RedeliveryPolicy(); log.debug("************ Start of Redelivery policy configuration ************"); if (!StringUtils.isEmpty(backOffMultiplier)) { log.debug(String.format("Overriding backOffMultiplier with value %s", backOffMultiplier)); policy.setBackOffMultiplier(Long.valueOf(backOffMultiplier)); } else {/*from w w w. j a va 2s . co m*/ log.debug(String.format("backOffMultiplier is set to the default value %s", policy.getBackOffMultiplier())); } if (!StringUtils.isEmpty(collisionAvoidancePercent)) { log.debug( String.format("Overriding collisionAvoidancePercent with value %s", collisionAvoidancePercent)); policy.setCollisionAvoidancePercent(Short.valueOf(collisionAvoidancePercent)); } else { log.debug(String.format("collisionAvoidancePercent is set to the default value %s", policy.getCollisionAvoidancePercent())); } if (!StringUtils.isEmpty(initialRedeliveryDelay)) { log.debug(String.format("Overriding initialRedeliveryDelay with value %s", initialRedeliveryDelay)); policy.setInitialRedeliveryDelay(Long.valueOf(initialRedeliveryDelay)); } else { log.debug(String.format("initialRedeliveryDelay is set to the default value %s", policy.getInitialRedeliveryDelay())); } if (!StringUtils.isEmpty(maximumRedeliveries)) { log.debug(String.format("Overriding maximumRedeliveries with value %s", maximumRedeliveries)); policy.setMaximumRedeliveries(Integer.valueOf(maximumRedeliveries)); } else { log.debug(String.format("maximumRedeliveries is set to the default value %s", policy.getMaximumRedeliveries())); } if (!StringUtils.isEmpty(maximumRedeliveryDelay)) { log.debug(String.format("Overriding maximumRedeliveryDelay with value %s", maximumRedeliveryDelay)); policy.setMaximumRedeliveryDelay(Integer.valueOf(maximumRedeliveryDelay)); } else { log.debug(String.format("maximumRedeliveryDelay is set to the default value %s", policy.getMaximumRedeliveryDelay())); } if (!StringUtils.isEmpty(redeliveryDelay)) { log.debug(String.format("Overriding redeliveryDelay with value %s", redeliveryDelay)); policy.setRedeliveryDelay(Integer.valueOf(redeliveryDelay)); } else { log.debug(String.format("redeliveryDelay is set to the default value %s", policy.getRedeliveryDelay())); } if (!StringUtils.isEmpty(useCollisionAvoidance)) { log.debug(String.format("Overriding useCollisionAvoidance with value %s", useCollisionAvoidance)); policy.setUseCollisionAvoidance(Boolean.valueOf(useCollisionAvoidance)); } else { log.debug(String.format("useCollisionAvoidance is set to the default value %s", policy.isUseCollisionAvoidance())); } if (!StringUtils.isEmpty(useExponentialBackOff)) { log.debug(String.format("Overriding useExponentialBackOff with value %s", useExponentialBackOff)); policy.setUseExponentialBackOff(Boolean.valueOf(useExponentialBackOff)); } else { log.debug(String.format("useExponentialBackOff is set to the default value %s", policy.isUseExponentialBackOff())); } log.debug("************ End of Redelivery policy configuration ************"); return policy; }
From source file:org.mifos.accounts.loan.struts.actionforms.LoanAccountActionFormTest.java
@Before public void setUp() throws Exception { form = new LoanAccountActionForm(); paymentMock = createMock(PaymentDataHtmlBean.class); expect(paymentMock.hasTotalAmount()).andReturn(true); actionErrors = new ActionErrors(); locale = new Locale("en", "GB"); installmentBuilder = new RepaymentScheduleInstallmentBuilder(locale); rupee = new MifosCurrency(Short.valueOf("1"), "Rupee", BigDecimal.valueOf(1), "INR"); }
From source file:org.mifos.customers.struts.action.CustSearchAction.java
private String retrieveOfficeName(CustSearchActionForm actionForm, Short userBranchId) { String officeName;/*from w w w.j a va 2 s . c om*/ if (StringUtils.isNotBlank(actionForm.getOfficeId())) { Short officeId = Short.valueOf(actionForm.getOfficeId()); officeName = this.centerServiceFacade.retrieveOfficeName(officeId); } else { officeName = this.centerServiceFacade.retrieveOfficeName(userBranchId); } return officeName; }
From source file:org.mifos.application.meeting.struts.actionforms.MeetingActionForm.java
public WeekDay getMonthWeekValue() { return StringUtils.isNotBlank(getMonthWeek()) ? WeekDay.getWeekDay(Short.valueOf(getMonthWeek())) : null; }