Package org.powermock.reflect.internal.matcherstrategies

Examples of org.powermock.reflect.internal.matcherstrategies.FieldTypeMatcherStrategy


   *            the type of the field
   * @param value
   *            the new value of the field
   */
  public static void setInternalState(Object object, Class<?> fieldType, Object value) {
    setField(object, value, findFieldInHierarchy(object, new FieldTypeMatcherStrategy(fieldType)));
  }
View Full Code Here


   * @param fieldType
   *            the type of the field
   */
  @SuppressWarnings("unchecked")
  public static <T> T getInternalState(Object object, Class<T> fieldType) {
    Field foundField = findFieldInHierarchy(object, new FieldTypeMatcherStrategy(fieldType));
    try {
      return (T) foundField.get(object);
    } catch (IllegalAccessException e) {
      throw new RuntimeException("Internal error: Failed to get field in method getInternalState.", e);
    }
View Full Code Here

TOP

Related Classes of org.powermock.reflect.internal.matcherstrategies.FieldTypeMatcherStrategy

Copyright © 2018 www.massapicom. 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.