示例#1
0
  public Object getParamValue(String param) {
    Assert.notEmpty(param, "param cannot be empty");

    AssertSyntax.isTrue(
        namedParamValues.containsKey(param), "Cannot find values for param '%s'", param);
    Object value = namedParamValues.get(param);

    return value;
  }
示例#2
0
  @Override
  public void afterPropertiesSet() {

    Assert.notEmpty(appCode, "appCode");
    Assert.notEmpty(separator, "separator");

    FormattingTuple.injectAppCode(appCode);

    this.nodeCode = createNodeCode();

    if (Tools.isBlank(this.nodeCode)) {

      throw new BeanCreationException(
          "createNodeCode() method in subclass of "
              + AppCodeApplication.class.getSimpleName()
              + ", the method return result "
              + "should not be null or empty");
    }

    LOGGER.info("Application: {}", this);
  }
 protected MmsClient(
     Context context,
     Looper looper,
     MobvoiApiClient.ConnectionCallbacks connectionCallbacks,
     MobvoiApiClient.OnConnectionFailedListener onConnectionFailedListener,
     String[] array) {
   this.mContext = ((Context) Assert.neNull(context));
   Assert.notEmpty(onConnectionFailedListener, "Looper must not be null");
   this.mLooper = looper;
   this.mEvents = new MmsClientEvents(this.mContext, this.mLooper, this);
   this.mHandler = new EventHandler(this.mLooper);
   registerConnectionCallbacks(
       (MobvoiApiClient.ConnectionCallbacks) Assert.neNull(connectionCallbacks));
   registerConnectionFailedListener(
       (MobvoiApiClient.OnConnectionFailedListener) Assert.neNull(onConnectionFailedListener));
 }
示例#4
0
 /**
  * Create a composite interface Class for the given interfaces, implementing the given interfaces
  * in one single Class.
  *
  * <p>This implementation builds a JDK proxy class for the given interfaces.
  *
  * @param interfaces the interfaces to merge
  * @param classLoader the ClassLoader to create the composite Class in
  * @return the merged interface as Class
  * @see java.lang.reflect.Proxy#getProxyClass
  */
 public static Class createCompositeInterface(Class[] interfaces, ClassLoader classLoader) {
   Assert.notEmpty(interfaces, "Interfaces must not be empty");
   Assert.notNull(classLoader, "ClassLoader must not be null");
   return Proxy.getProxyClass(classLoader, interfaces);
 }
示例#5
0
 /**
  * @param name The name of this turn. Not empty.
  * @param destination The URI of the destination (telephone, IP telephony address). Not empty.
  */
 public Transfer(String name, String destination) {
   super(name);
   Assert.notEmpty(destination, "destination");
   mDestination = destination;
 }
示例#6
0
 /**
  * @param name The name of this turn. Not empty.
  * @param uri The URI of the subdialogue. Not empty.
  */
 public SubdialogueCall(String name, String uri) {
   super(name);
   Assert.notEmpty(uri, "uri");
   mUri = uri;
 }
示例#7
0
 public Builder addSubmitParameterExpression(String name, String expression) {
   Assert.notEmpty(name, "name");
   mSubmitParameters.addWithExpression(name, expression);
   return this;
 }
示例#8
0
 public Builder addSubmitParameterString(String name, String string) {
   Assert.notEmpty(name, "name");
   mSubmitParameters.addWithString(name, string);
   return this;
 }
示例#9
0
 private Parameter(String name) {
   Assert.notEmpty(name, "name");
   mName = name;
 }
示例#10
0
 public Builder uri(String uri) {
   Assert.notEmpty(uri, "uri");
   mUri = uri;
   return this;
 }
示例#11
0
 @Test
 public void assertNotEmptyWithMapSunnyDay() throws Exception {
   Map<String, String> map = new HashMap<String, String>();
   map.put("", "");
   Assert.notEmpty(map);
 }
示例#12
0
 @Test(expected = IllegalArgumentException.class)
 public void assertNotEmptyWithEmptyMapThrowsException() throws Exception {
   Assert.notEmpty(new HashMap<Object, Object>());
 }
示例#13
0
 @Test(expected = IllegalArgumentException.class)
 public void assertNotEmptyWithNullMapThrowsException() throws Exception {
   Assert.notEmpty((Map<?, ?>) null);
 }
示例#14
0
 @Test
 public void assertNotEmptyWithCollectionSunnyDay() throws Exception {
   List<String> collection = new ArrayList<String>();
   collection.add("");
   Assert.notEmpty(collection);
 }
示例#15
0
 @Test(expected = IllegalArgumentException.class)
 public void assertNotEmptyWithEmptyCollectionThrowsException() throws Exception {
   Assert.notEmpty(new ArrayList<Object>());
 }