Returns a {@link Statement} that stores the {@code value} in this field on the given {@code
instance}.

@throws IllegalStateException if this is a static field
420271
public Statement putStaticField(final Expression value) {
    checkState(isStatic(), "This field is not static!");
    value.checkAssignableTo(type());
    return new Statement() {
      @Override
      protected void doGen(CodeBuilder adapter) {
        value.gen(adapter);
        adapter.putStatic(owner().type(), name(), type());
      }
    };
  }
293196
public static ResourceField getInstance(int value)
   {
      ResourceField result = null;

      if (value >= 0 && value < FIELD_ARRAY.length)
      {
         result = FIELD_ARRAY[value];
      }
      else
      {
         if ((value & 0x8000) != 0)
         {
            int baseValue = ResourceField.ENTERPRISE_CUSTOM_FIELD1.getValue();
            int id = baseValue + (value & 0xFFF);
            result = ResourceField.getInstance(id);
         }
      }

      return (result);
   }
654738
public V getValue(T object) {
        try {
            if (this.getMethod != null) {
                return (V)this.getMethod.invoke(object);
            } else {
                return (V)this.field.get(object);
            }
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }
232558
public static void setValue(Object instance, String fieldName, Object value) {
        try {
            Field f = findFieldRecursively(instance.getClass(), fieldName);
            if (f == null)
                throw new NoSuchMethodException("Cannot find field " + fieldName + " on " + instance.getClass() + " or superclasses");
            f.setAccessible(true);
            f.set(instance, value);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
476513
public Object getFieldValue(final Object instance) {
        try {
            return field.get(instance);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
1007305
@Override
    public void set(Instance<?> value) throws InvocationException {
        try {
            if (!field.isAccessible()) {
                field.setAccessible(true);
            }
            field.set(target, value);
        } catch (Exception e) {
            throw new InvocationException(e.getCause());
        }
    }
814824
public static PactDslRootValue booleanType(Boolean example) {
    PactDslRootValue value = new PactDslRootValue();
    value.setValue(example);
    value.setMatcher(TypeMatcher.INSTANCE);
    return value;
  }
514672
public <T> Entity get(String field, T value) throws SQLException {
		return this.get(Entity.create(tableName).set(field, value));
	}
981096
protected AssociationValue createInstance() {
		Map<String, Attribute<?>> attributes = new HashMap<String, Attribute<?>>();
		for (AbstractAttributeInfo attrInfo : featureInfo.getAttributes()) {
			if (attrInfo instanceof PrimitiveAttributeInfo) {
				attributes.put(attrInfo.getName(), AttributeUtil.createEmptyPrimitiveAttribute(
						(PrimitiveAttributeInfo) attrInfo));
			} else if (attrInfo instanceof AssociationAttributeInfo) {
				AssociationAttributeInfo assocInfo = (AssociationAttributeInfo) attrInfo;
				switch (assocInfo.getType()) {
					case MANY_TO_ONE:
						attributes.put(assocInfo.getName(), new ManyToOneAttribute());
						break;
					case ONE_TO_MANY:
						OneToManyAttribute oneToMany = new OneToManyAttribute();
						oneToMany.setValue(new ArrayList<AssociationValue>());
						attributes.put(assocInfo.getName(), oneToMany);
						break;
					default:
						throw new IllegalStateException("Don't know how to handle association type " +
								assocInfo.getType());
				}
			}
		}
		AssociationValue value = new AssociationValue();
		value.setAllAttributes(attributes);
		value.setId(AttributeUtil.createEmptyPrimitiveAttribute(featureInfo.getIdentifier()));
		return value;
	}
1344635
private void storeStaticField(XField staticField, Instruction obj, boolean pushStoredValue) {
        if (RLE_DEBUG) {
            System.out.println("[storeStaticField for field " + staticField + " in instruction " + handle);
        }

        ValueNumberFrame frame = getFrame();

        AvailableLoad availableLoad = new AvailableLoad(staticField);

        int numWordsConsumed = getNumWordsConsumed(obj);
        ValueNumber[] inputValueList = popInputValues(numWordsConsumed);

        if (pushStoredValue) {
            pushOutputValues(inputValueList);
        }

        // Kill loads of this field
        frame.killLoadsOfField(staticField);

        // Make load available
        frame.addAvailableLoad(availableLoad, inputValueList);

        if (RLE_DEBUG) {
            System.out.println("[making store of " + staticField + " available]");
        }

        if (VERIFY_INTEGRITY) {
            checkConsumedAndProducedValues(obj, inputValueList, pushStoredValue ? inputValueList : EMPTY_INPUT_VALUE_LIST);
        }
    }
229969
@Override
    public void set(T value) {
        if (scope == null) {
            throw new IllegalStateException("Value can not be set, instance has no Scope defined: " + value);
        }
        manager.bindAndFire(scope, type, value);
    }
574880
public @Nonnull PropertyType getPropertyTypeOrDie(@Nonnull Object instance, @Nonnull String field) {
        PropertyType propertyType = getPropertyType(instance, field);
        if (propertyType != null) {
            return propertyType;
        } else if (instance == this) {
            throw new AssertionError(getClass().getName() + " has no property " + field);
        } else {
            throw new AssertionError(clazz.getName() + " has no property " + field);
        }
    }
1231735
public static <V extends Value> ValueList<V> getInstance(V... value) {
        ValueList<V> result = new ValueList<>(value.length);
        for (V val : value) {
            result.add(val);
        }
        return result;
    }
637029
public static Object newInstance(String name) {
        try {
            return forName(name).newInstance();
        } catch (InstantiationException e) {
            throw new IllegalStateException(e.getMessage(), e);
        } catch (IllegalAccessException e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
    }
277018
public static Object getValue(Object instance, String fieldName) {
      Field f = findFieldRecursively(instance.getClass(), fieldName);
      if (f == null) throw new CacheException("Could not find field named '" + fieldName + "' on instance " + instance);
      try {
         f.setAccessible(true);
         return f.get(instance);
      } catch (IllegalAccessException iae) {
         throw new CacheException("Cannot access field " + f, iae);
      }
   }
1069482
private void loadInstanceField(XField instanceField, Instruction obj) {
        if (RLE_DEBUG) {
            System.out.println("[loadInstanceField for field " + instanceField + " in instruction " + handle);
        }

        ValueNumberFrame frame = getFrame();

        try {
            ValueNumber reference = frame.popValue();

            AvailableLoad availableLoad = new AvailableLoad(reference, instanceField);
            if (RLE_DEBUG) {
                System.out.println("[getfield of " + availableLoad + "]");
            }
            ValueNumber[] loadedValue = frame.getAvailableLoad(availableLoad);

            if (loadedValue == null) {
                // Get (or create) the cached result for this instruction
                ValueNumber[] inputValueList = new ValueNumber[] { reference };
                loadedValue = getOutputValues(inputValueList, getNumWordsProduced(obj));

                // Make the load available
                frame.addAvailableLoad(availableLoad, loadedValue);
                if (RLE_DEBUG) {
                    System.out.println("[Making load available " + availableLoad + " <- " + vlts(loadedValue) + "]");
                }
            } else {
                // Found an available load!
                if (RLE_DEBUG) {
                    System.out.println("[Found available load " + availableLoad + " <- " + vlts(loadedValue) + "]");
                }
            }

            pushOutputValues(loadedValue);

            if (VERIFY_INTEGRITY) {
                checkConsumedAndProducedValues(obj, new ValueNumber[] { reference }, loadedValue);
            }
        } catch (DataflowAnalysisException e) {
            throw new InvalidBytecodeException("Error loading from instance field", e);
        }
    }
112177
public void setFieldValue(final Object instance, final Object value) {
        try {
            field.set(instance, value);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }