Examples of TooManyObjectsException


Examples of br.net.woodstock.rockframework.domain.TooManyObjectsException

    Map<String, Object> map = this.context.getBeansOfType(clazz);
    if (map.size() == 0) {
      throw new ObjectNotFoundException("Object not found for type " + clazz.getCanonicalName());
    }
    if (map.size() > 1) {
      throw new TooManyObjectsException("To many objects found for type " + clazz.getCanonicalName());
    }

    return (T) map.values().iterator().next();
  }
View Full Code Here

Examples of br.net.woodstock.rockframework.domain.TooManyObjectsException

    Map<String, T> map = this.context.getBeansOfType(clazz);
    if (map.size() == 0) {
      throw new ObjectNotFoundException("Object not found for type " + clazz.getCanonicalName());
    }
    if (map.size() > 1) {
      throw new TooManyObjectsException("To many objects found for type " + clazz.getCanonicalName());
    }

    return map.values().iterator().next();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.