@Override @SuppressWarnings("deprecation") protected void doSetFieldValue(Field field, FieldValue value) { if (field.isHeader()) { header.setFieldValue(field, value); } else { body.setFieldValue(field, value); } }
/** * Clears this and assigns from the given {@link StructuredFieldValue} */ public void assignFrom(StructuredFieldValue sfv) { clear(); Iterator<Map.Entry<Field,FieldValue>> otherValues = sfv.iterator(); while (otherValues.hasNext()) { Map.Entry<Field, FieldValue> otherEntry = otherValues.next(); setFieldValue(otherEntry.getKey(), otherEntry.getValue()); } }
public static Struct valueOf(Integer x, Integer y) { Struct ret = new Struct(INSTANCE); ret.setFieldValue(FIELD_X, x != null ? new IntegerFieldValue(x) : null); ret.setFieldValue(FIELD_Y, y != null ? new IntegerFieldValue(y) : null); return ret; }
@Override public void assign(Object o) { if ((o instanceof Struct) && ((Struct) o).getDataType().equals(getDataType())) { clear(); Iterator<Map.Entry<Field,FieldValue>> otherValues = ((Struct) o).iterator(); while (otherValues.hasNext()) { Map.Entry<Field, FieldValue> otherEntry = otherValues.next(); setFieldValue(otherEntry.getKey(), otherEntry.getValue()); } } else { throw new IllegalArgumentException("Type " + o.getClass() + " can not specify a " + getClass() + " instance"); } }
value.setFieldValue(structField, fieldValue); skipToEnd(structField.getName()); foundField = true;
FieldValue value = structField.getDataType().createFieldValue(); value.deserialize(structField, this); s.setFieldValue(structField, value);
FieldValue value = structField.getDataType().createFieldValue(); value.deserialize(structField, this); s.setFieldValue(structField, value);
FieldValue value = structField.getDataType().createFieldValue(); value.deserialize(structField, this); s.setFieldValue(structField, value);
FieldValue value = structField.getDataType().createFieldValue(); value.deserialize(structField, this); s.setFieldValue(structField, value);