@@ -202,8 +202,6 @@ public boolean TryGetDateTimeFields(CBORObject obj, EInteger[] year, int[]
202202 // TODO: In next major version, return false instead of throwing an
203203 // exception if the arguments are invalid, to conform to convention
204204 // with Try* methods in DotNet.
205- // TODO: In next minor version, add overload that takes an out parameter
206- // for year to DotNet version.
207205 if (year == null ) {
208206 throw new NullPointerException ("year" );
209207 }
@@ -373,7 +371,24 @@ public CBORObject DateTimeFieldsToCBORObject(
373371 /**
374372 * Converts a date/time in the form of a year, month, day, hour, minute,
375373 * second, fractional seconds, and time offset to a CBOR object.
376- * @param bigYear The parameter {@code bigYear} is a Numbers.EInteger object.
374+ * @param year Not documented yet.
375+ * @param lesserFields Not documented yet.
376+ * @return A CBOR object encoding the given date fields according to the
377+ * conversion type used to create this date converter.
378+ * @throws NullPointerException The parameter {@code bigYear} or {@code
379+ * lesserFields} is null.
380+ * @throws com.upokecenter.cbor.CBORException An error occurred in conversion.
381+ */
382+ public CBORObject DateTimeFieldsToCBORObject (int year , int []
383+ lesserFields ) {
384+ return this .DateTimeFieldsToCBORObject (EInteger .FromInt32 (year ),
385+ lesserFields );
386+ }
387+
388+ /**
389+ * Converts a date/time in the form of a year, month, day, hour, minute,
390+ * second, fractional seconds, and time offset to a CBOR object.
391+ * @param bigYear The year.
377392 * @param lesserFields An array that will store the fields (other than the
378393 * year) of the date and time. See the TryGetDateTimeFields method for
379394 * information on the "lesserFields" parameter.
@@ -385,8 +400,6 @@ public CBORObject DateTimeFieldsToCBORObject(
385400 */
386401 public CBORObject DateTimeFieldsToCBORObject (EInteger bigYear , int []
387402 lesserFields ) {
388- // TODO: In next minor version, add overload that takes int rather than
389- // EInteger
390403 if (bigYear == null ) {
391404 throw new NullPointerException ("bigYear" );
392405 }
0 commit comments