public DateMidnight withField(DateTimeFieldType fieldType, int value) {
        if (fieldType == null) {
            throw new IllegalArgumentException("Field must not be null");
        }
        long instant = fieldType.getField(getChronology()).set(getMillis(), value);
        return withMillis(instant);
    }
public DateMidnight withField ( DateTimeFieldType fieldType , int value ) { if ( fieldType == null ) { throw new IllegalArgumentException ( "Field must not be null" ) ; } long instant = fieldType . getField ( getChronology ( ) ) . set ( getMillis ( ) , value ) ; return withMillis ( instant ) ; }
Returns a copy of this date with the specified field set to a new value.
<p>
For example, if the field type is <code>dayOfMonth</code> then the day of month
field would be changed in the returned instance.
If the field type is null, then <code>this</code> is returned.
<p>
These three lines are equivalent:
<pre>
DateTime updated = dt.withField(DateTimeFieldType.dayOfMonth(), 6);
DateTime updated = dt.dayOfMonth().setCopy(6);
DateTime updated = dt.property(DateTimeFieldType.dayOfMonth()).setCopy(6);
</pre>

@param fieldType  the field type to set, not null
@param value  the value to set
@return a copy of this datetime with the field set
@throws IllegalArgumentException if the value is null or invalid