OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 74 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 74 Rev 181
Line 37... Line 37...
37
    }
37
    }
38
 
38
 
39
    @Override
39
    @Override
40
    public String toString() {
40
    public String toString() {
41
        String string = this.table + " " + this.name + " type:" + this.type + " default:" + this.defaultValue + " l:" + this.length + " t:" + this.foreignTable;
41
        String string = this.table + " " + this.name + " type:" + this.type + " default:" + this.defaultValue + " l:" + this.length + " t:" + this.foreignTable;
42
        if (link != null) {
42
        if (this.link != null) {
43
            string += " => " + link.toString();
43
            string += " => " + this.link.toString();
44
        }
44
        }
45
        return string;
45
        return string;
46
    }
46
    }
47
 
47
 
48
    public String getName() {
48
    public String getName() {
49
        return name;
49
        return this.name;
50
    }
50
    }
51
 
51
 
52
    public void setName(String name) {
52
    public void setName(String name) {
53
        this.name = name;
53
        this.name = name;
54
    }
54
    }
55
 
55
 
56
    public String getType() {
56
    public String getType() {
57
        return type;
57
        return this.type;
58
    }
58
    }
59
 
59
 
60
    public void setType(String type) {
60
    public void setType(String type) {
61
        this.type = type;
61
        this.type = type;
62
    }
62
    }
63
 
63
 
64
    public String getDefaultValue() {
64
    public String getDefaultValue() {
65
        return defaultValue;
65
        return this.defaultValue;
66
    }
66
    }
67
 
67
 
68
    public void setDefaultValue(String defaultValue) {
68
    public void setDefaultValue(String defaultValue) {
69
        this.defaultValue = defaultValue;
69
        this.defaultValue = defaultValue;
70
    }
70
    }
71
 
71
 
72
    public String getLength() {
72
    public String getLength() {
73
        return length;
73
        return this.length;
74
    }
74
    }
75
 
75
 
76
    public void setLength(String length) {
76
    public void setLength(String length) {
77
        this.length = length;
77
        this.length = length;
78
    }
78
    }
79
 
79
 
80
    public String getTable() {
80
    public String getTable() {
81
        return table;
81
        return this.table;
82
    }
82
    }
83
 
83
 
84
    public void setLink(FieldDescriptor fieldDescriptor) {
84
    public void setLink(FieldDescriptor fieldDescriptor) {
85
        this.link = fieldDescriptor;
85
        this.link = fieldDescriptor;
86
    }
86
    }
87
 
87
 
88
    public FieldDescriptor getLink() {
88
    public FieldDescriptor getLink() {
89
        return link;
89
        return this.link;
90
    }
90
    }
91
 
91
 
92
    public void setForeignTable(String foreignTable) {
92
    public void setForeignTable(String foreignTable) {
93
        this.foreignTable = foreignTable;
93
        this.foreignTable = foreignTable;
94
    }
94
    }
95
 
95
 
96
    public String getForeignTable() {
96
    public String getForeignTable() {
97
        return foreignTable;
97
        return this.foreignTable;
98
    }
98
    }
99
 
99
 
100
    public String getExtendedLabel() {
100
    public String getExtendedLabel() {
101
        FieldDescriptor f = this;
101
        FieldDescriptor f = this;
102
        String label = f.getName();
102
        String label = f.getName();
Line 109... Line 109...
109
 
109
 
110
    @Override
110
    @Override
111
    public boolean equals(Object obj) {
111
    public boolean equals(Object obj) {
112
        if (obj instanceof FieldDescriptor) {
112
        if (obj instanceof FieldDescriptor) {
113
            FieldDescriptor f = (FieldDescriptor) obj;
113
            FieldDescriptor f = (FieldDescriptor) obj;
114
            if (getTable().equals(f.getTable()) && getName().equals(f.getTable())) {
114
            if (getTable().equals(f.getTable()) && getName().equals(f.getName())) {
115
                return getLink() != null && getLink().equals(f.getLink());
115
                return (getLink() == null && f.getLink() == null) || (getLink() != null && getLink().equals(f.getLink()));
116
            } else {
116
            } else {
117
                return false;
117
                return false;
118
            }
118
            }
119
        }
119
        }
120
        return false;
120
        return false;