Exemple #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;
  }
Exemple #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));
 }
 /**
  * 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);
 }
Exemple #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;
 }
 /**
  * @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;
 }
 public Builder addSubmitParameterExpression(String name, String expression) {
   Assert.notEmpty(name, "name");
   mSubmitParameters.addWithExpression(name, expression);
   return this;
 }
 public Builder addSubmitParameterString(String name, String string) {
   Assert.notEmpty(name, "name");
   mSubmitParameters.addWithString(name, string);
   return this;
 }
 private Parameter(String name) {
   Assert.notEmpty(name, "name");
   mName = name;
 }
 public Builder uri(String uri) {
   Assert.notEmpty(uri, "uri");
   mUri = uri;
   return this;
 }
 @Test
 public void assertNotEmptyWithMapSunnyDay() throws Exception {
   Map<String, String> map = new HashMap<String, String>();
   map.put("", "");
   Assert.notEmpty(map);
 }
 @Test(expected = IllegalArgumentException.class)
 public void assertNotEmptyWithEmptyMapThrowsException() throws Exception {
   Assert.notEmpty(new HashMap<Object, Object>());
 }
 @Test(expected = IllegalArgumentException.class)
 public void assertNotEmptyWithNullMapThrowsException() throws Exception {
   Assert.notEmpty((Map<?, ?>) null);
 }
 @Test
 public void assertNotEmptyWithCollectionSunnyDay() throws Exception {
   List<String> collection = new ArrayList<String>();
   collection.add("");
   Assert.notEmpty(collection);
 }
 @Test(expected = IllegalArgumentException.class)
 public void assertNotEmptyWithEmptyCollectionThrowsException() throws Exception {
   Assert.notEmpty(new ArrayList<Object>());
 }