/** * Returns the first valid implementation as a BoundMethod or throws a * RuntimeException if there is none. * * @param target an Object on which to get and set the field * @param <T> Java class stored in the field * @return a {@link BoundField} with a valid implementation and target * @throws IllegalStateException if the method is static * @throws IllegalArgumentException if the receiver's class is incompatible * @throws RuntimeException if no implementation was found */ public <T> BoundField<T> build(Object target) { return this.<T>build().bind(target); }
/** * Returns the first valid implementation as a StaticField or throws a * RuntimeException if there is none. * * @param <T> Java class stored in the field * @return a {@link StaticField} with a valid implementation * @throws IllegalStateException if the method is not static * @throws RuntimeException if no implementation was found */ public <T> StaticField<T> buildStatic() { return this.<T>build().asStatic(); }