Package org.cyclos.impl.utils.sms
Class SmsParameterProcessor
- java.lang.Object
-
- org.cyclos.impl.utils.sms.SmsParameterProcessor
-
public class SmsParameterProcessor extends Object
Utility class used to consume inbound SMS parameters
-
-
Constructor Summary
Constructors Constructor Description SmsParameterProcessor(UserLocatorHandler userLocatorHandler, SmsOperationConfiguration operationConfiguration, List<String> params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Returns whether there is another parameterBigDecimalnextAmount(Object paramIdentifier, int precision)BigDecimalnextDecimal(Object paramIdentifier)Returns the next parameter as a decimal numberintnextInt(Object paramIdentifier)Returns the next parameter as intStringnextString(Object paramIdentifier)Returns the next parameter as stringUsernextUser(Object paramIdentifier)Returns the next parameter as user.UsernextUserForPayment(Object paramIdentifier)Returns the next parameter as User, forcing the payment principal types in the sms channel configurationStringremaining(Object paramIdentifier, String separator)Returns all remaining parameters, joined with a given separator
-
-
-
Constructor Detail
-
SmsParameterProcessor
public SmsParameterProcessor(UserLocatorHandler userLocatorHandler, SmsOperationConfiguration operationConfiguration, List<String> params)
-
-
Method Detail
-
hasNext
public boolean hasNext()
Returns whether there is another parameter
-
nextAmount
public BigDecimal nextAmount(Object paramIdentifier, int precision) throws InboundSmsParameterException
- Throws:
InboundSmsParameterException
-
nextDecimal
public BigDecimal nextDecimal(Object paramIdentifier) throws InboundSmsParameterException
Returns the next parameter as a decimal number- Throws:
InboundSmsParameterException
-
nextInt
public int nextInt(Object paramIdentifier) throws InboundSmsParameterException
Returns the next parameter as int- Throws:
InboundSmsParameterException
-
nextString
public String nextString(Object paramIdentifier) throws InboundSmsParameterException
Returns the next parameter as string- Throws:
InboundSmsParameterException
-
nextUser
public User nextUser(Object paramIdentifier) throws InboundSmsParameterException
Returns the next parameter as user. Should normally not be used if the user is either the source or destination of a payment. In such cases, usenextUserForPayment(Object)instead, as the principal type defined in the channel configuration is enforced.- Throws:
InboundSmsParameterException- See Also:
UserLocatorHandler.locate(UserLocatorVO)
-
nextUserForPayment
public User nextUserForPayment(Object paramIdentifier) throws InboundSmsParameterException
Returns the next parameter as User, forcing the payment principal types in the sms channel configuration
-
remaining
public String remaining(Object paramIdentifier, String separator) throws InboundSmsParameterException
Returns all remaining parameters, joined with a given separator- Throws:
InboundSmsParameterException
-
-