Kenmegne
6 days ago 8cbaa370347e6fc997381cf35d6c295685b90f98
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.megatim.dynamicjsonparser.pojo;
 
import com.megatim.dynamicjsonparser.enums.TypeDonnee;
import java.util.ArrayList;
import java.util.List;
 
/**
 *
 * @author ASUS
 */
public class JsonDataType {
 
    //nom du champ
    private String fieldName;
 
    //Type du champ si ce type est un primitif
    private TypeDonnee typeDonnee;
 
    // Liste des attributs de l'objet, si le type du champ est un objet Java à définir
    private List<JsonDataType> jsonDataTypes = new ArrayList<>();
 
    //Renseigne si ce champ est une collection(liste)
    private boolean collection;
 
    //Nom de la classe à laquelle appartient ce champ
    private String className;
 
    private String formatDate;
 
    private String separateurDate;
 
    private boolean required;
 
    public JsonDataType(String fieldName, TypeDonnee typeDonnee, String className, boolean collection) {
        this.fieldName = fieldName;
        this.typeDonnee = typeDonnee;
        this.className = className;
        this.collection = collection;
    }
 
    public JsonDataType(String fieldName, List<JsonDataType> jsonDataTypes, String className, boolean collection) {
        this.fieldName = fieldName;
        this.jsonDataTypes = jsonDataTypes;
        this.className = className;
        this.collection = collection;
        this.typeDonnee = TypeDonnee.OBJET;
    }
 
    public JsonDataType(String fieldName, TypeDonnee typeDonnee, String className, boolean required, boolean collection) {
        this.fieldName = fieldName;
        this.typeDonnee = typeDonnee;
        this.className = className;
        this.required = required;
        this.collection = collection;
    }
 
    public JsonDataType(String fieldName, List<JsonDataType> jsonDataTypes, String className, boolean required, boolean collection) {
        this.fieldName = fieldName;
        this.jsonDataTypes = jsonDataTypes;
        this.className = className;
        this.required = required;
        this.collection = collection;
        this.typeDonnee = TypeDonnee.OBJET;
    }
 
    @Override
    public String toString() {
        return "JsonDataType{" + "fieldName=" + fieldName + ", typeDonnee=" + typeDonnee + ", jsonDataTypes=" + jsonDataTypes + ", collection=" + collection + ", className=" + className + ", formatDate=" + formatDate + ", separateurDate=" + separateurDate + ", required=" + required + '}';
    }
 
    public String getFieldName() {
        return fieldName;
    }
 
    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }
 
    public TypeDonnee getTypeDonnee() {
        return typeDonnee;
    }
 
    public void setTypeDonnee(TypeDonnee typeDonnee) {
        this.typeDonnee = typeDonnee;
    }
 
    public List<JsonDataType> getJsonDataTypes() {
        return jsonDataTypes;
    }
 
    public void setJsonDataTypes(List<JsonDataType> jsonDataTypes) {
        this.jsonDataTypes = jsonDataTypes;
    }
 
    public String getClassName() {
        return className;
    }
 
    public void setClassName(String className) {
        this.className = className;
    }
 
    public boolean isCollection() {
        return collection;
    }
 
    public void setCollection(boolean collection) {
        this.collection = collection;
    }
 
    public String getFormatDate() {
        return formatDate;
    }
 
    public void setFormatDate(String formatDate) {
        this.formatDate = formatDate;
    }
 
    public String getSeparateurDate() {
        return separateurDate;
    }
 
    public void setSeparateurDate(String separateurDate) {
        this.separateurDate = separateurDate;
    }
 
    public boolean isRequired() {
        return required;
    }
 
    public void setRequired(boolean required) {
        this.required = required;
    }
}