/** * Sets new value by name, on the specified object. The new value * is automatically unwrapped if the underlying field has a primitive type. * * @param o the specified object * @param name the name of the the field in object * @param value the new value for the field in object */ public static void setValue(Object o, String name, Object value) { try { Field fd = setAccessible(getField(o.getClass(), name)); fd.set(o, value); } catch (Exception e) { ThrowUtil.throwException(e); } }
/** * Returns the value by name, on the specified object. The value is * automatically wrapped in an object if it has a primitive type. * * @param o the specified object * @param name the name of the represented field in object * @return the value of the represented field in object */ public static Object getValue(Object o, String name) { Object value = null; try { Field fd = setAccessible(getField(o.getClass(), name)); value = fd.get(o); } catch (Exception e) { ThrowUtil.throwException(e); } return value; }
/** * Returns the value by name, on the specified object. The value is * automatically wrapped in an object if it has a primitive type. * * @param o the specified object * @param name the name of the represented field in object * @return the value of the represented field in object */ public static Object getValue(Object o, String name) { Object value = null; try { Field fd = setAccessible(getField(o.getClass(), name)); value = fd.get(o); } catch (Exception e) { ThrowUtil.throwException(e); } return value; }
/** * Sets new value by name, on the specified object. The new value * is automatically unwrapped if the underlying field has a primitive type. * * @param o the specified object * @param name the name of the the field in object * @param value the new value for the field in object */ public static void setValue(Object o, String name, Object value) { try { Field fd = setAccessible(getField(o.getClass(), name)); fd.set(o, value); } catch (Exception e) { ThrowUtil.throwException(e); } }
/** * Sets new value by name, on the specified {@code Class}. The new value is * automatically unwrapped if the underlying field has * a primitive type. * * @param clazz the specified class * @param name the name of the the field in class * @param value the new value for the field in class */ public static void setStaticValue(Class<?> clazz, String name, Object value) { try { Field fd = setAccessible(getField(clazz, name)); fd.set(null, value); } catch (Exception e) { ThrowUtil.throwException(e); } }
/** * Sets new value by name, on the specified {@code Class}. The new value is * automatically unwrapped if the underlying field has * a primitive type. * * @param clazz the specified class * @param name the name of the the field in class * @param value the new value for the field in class */ public static void setStaticValue(Class<?> clazz, String name, Object value) { try { Field fd = setAccessible(getField(clazz, name)); fd.set(null, value); } catch (Exception e) { ThrowUtil.throwException(e); } }
/** * Returns the static value by name, on the specified {@code Class}. The value is * automatically wrapped in an object if it has a primitive type. * * @param clazz the specified class * @param name the name of the represented field in class * @return the value of the represented field in class */ public static Object getStaticValue(Class<?> clazz, String name) { Object value = null; try { Field fd = setAccessible(getField(clazz, name)); value = fd.get(null); } catch (Exception e) { ThrowUtil.throwException(e); } return value; }
/** * Returns the static value by name, on the specified {@code Class}. The value is * automatically wrapped in an object if it has a primitive type. * * @param clazz the specified class * @param name the name of the represented field in class * @return the value of the represented field in class */ public static Object getStaticValue(Class<?> clazz, String name) { Object value = null; try { Field fd = setAccessible(getField(clazz, name)); value = fd.get(null); } catch (Exception e) { ThrowUtil.throwException(e); } return value; }
/** * Sets new value by name, on the specified object. The new value * is automatically unwrapped if the underlying field has a primitive type. * * @param o the specified object * @param name the name of the the field in object * @param value the new value for the field in object */ public static void setValue(Object o, String name, Object value) { try { Field fd = setAccessible(getField(o.getClass(), name)); fd.set(o, value); } catch (Exception e) { ThrowUtil.throwException(e); } }
/** * Sets new value by name, on the specified object. The new value * is automatically unwrapped if the underlying field has a primitive type. * * @param o the specified object * @param name the name of the the field in object * @param value the new value for the field in object */ public static void setValue(Object o, String name, Object value) { try { Field fd = setAccessible(getField(o.getClass(), name)); fd.set(o, value); } catch (Exception e) { ThrowUtil.throwException(e); } }
/** * Sets new value by name, on the specified {@code Class}. The new value is * automatically unwrapped if the underlying field has * a primitive type. * * @param clazz the specified class * @param name the name of the the field in class * @param value the new value for the field in class */ public static void setStaticValue(Class<?> clazz, String name, Object value) { try { Field fd = setAccessible(getField(clazz, name)); fd.set(null, value); } catch (Exception e) { ThrowUtil.throwException(e); } }
/** * Returns the value by name, on the specified object. The value is * automatically wrapped in an object if it has a primitive type. * * @param o the specified object * @param name the name of the represented field in object * @return the value of the represented field in object */ public static Object getValue(Object o, String name) { Object value = null; try { Field fd = setAccessible(getField(o.getClass(), name)); value = fd.get(o); } catch (Exception e) { ThrowUtil.throwException(e); } return value; }
/** * Returns the value by name, on the specified object. The value is * automatically wrapped in an object if it has a primitive type. * * @param o the specified object * @param name the name of the represented field in object * @return the value of the represented field in object */ public static Object getValue(Object o, String name) { Object value = null; try { Field fd = setAccessible(getField(o.getClass(), name)); value = fd.get(o); } catch (Exception e) { ThrowUtil.throwException(e); } return value; }
/** * Returns the static value by name, on the specified {@code Class}. The value is * automatically wrapped in an object if it has a primitive type. * * @param clazz the specified class * @param name the name of the represented field in class * @return the value of the represented field in class */ public static Object getStaticValue(Class<?> clazz, String name) { Object value = null; try { Field fd = setAccessible(getField(clazz, name)); value = fd.get(null); } catch (Exception e) { ThrowUtil.throwException(e); } return value; }
/** * Sets new value by name, on the specified {@code Class}. The new value is * automatically unwrapped if the underlying field has * a primitive type. * * @param clazz the specified class * @param name the name of the the field in class * @param value the new value for the field in class */ public static void setStaticValue(Class<?> clazz, String name, Object value) { try { Field fd = setAccessible(getField(clazz, name)); fd.set(null, value); } catch (Exception e) { ThrowUtil.throwException(e); } }
/** * Returns the static value by name, on the specified {@code Class}. The value is * automatically wrapped in an object if it has a primitive type. * * @param clazz the specified class * @param name the name of the represented field in class * @return the value of the represented field in class */ public static Object getStaticValue(Class<?> clazz, String name) { Object value = null; try { Field fd = setAccessible(getField(clazz, name)); value = fd.get(null); } catch (Exception e) { ThrowUtil.throwException(e); } return value; }