[JAVA-2762] Add toString() methods to model class Created: 31/Jan/18  Updated: 28/Oct/23  Resolved: 05/Feb/18

Status: Closed
Project: Java Driver
Component/s: Builders
Affects Version/s: None
Fix Version/s: 3.7.0

Type: Improvement Priority: Minor - P4
Reporter: Farès Hassak Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVA-2000 Add toString() methods to Bson instan... Closed

 Description   

Hello,

For same reason that JAVA-2000,

Add toString() methods to model class :

public class Field<TExpression> {
 
    @Override
    public String toString() {
        return "Field{"
                + "name='" + name + '\''
                + ", value=" + value
                + '}';
    }
}

And correct existing toString() :

        public String toString() {
            return "Stage{"
                + "name='$bucketAuto'"
                + "buckets=" + buckets // the comma is missing, so the previous line is concatenated to this one without separator
                + ", groupBy=" + groupBy
                + ", options=" + options
                + '}';
 

I'm woking on PR.



 Comments   
Comment by Githook User [ 05/Feb/18 ]

Author:

{'email': 'fares.hassak@gmail.com', 'name': 'Farès Hassak', 'username': 'fhassak'}

Message: JAVA-2762 : Override toString() method in model class
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/286ccd9ea5395eb20556d080213416b5c9544cd2

Generated at Thu Feb 08 08:58:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.