@Nullable public static Instant getInstant(BsonDocument doc, DateTimeField field, Instant defaultValue) throws TypesMismatchException { return getInstant(doc, field.getFieldName(), defaultValue); }
@Nonnull public static Instant getInstant(BsonDocument doc, String fieldId) throws TypesMismatchException, NoSuchKeyException { return getInstant(getEntry(doc, fieldId), fieldId); }
@Nonnull public static Instant getInstant(Entry<?> entry, DateTimeField field) throws TypesMismatchException { return getInstant(entry, field.getFieldName()); }
@Nonnull public static Instant getInstant(BsonDocument doc, DateTimeField field) throws TypesMismatchException, NoSuchKeyException { return getInstant(doc, field.getFieldName()); }
@Nullable public static Instant getInstant(BsonDocument doc, String fieldId, Instant defaultValue) throws TypesMismatchException { Entry<?> entry = doc.getEntry(fieldId); if (entry == null) { return defaultValue; } return getInstant(entry, fieldId); }