@@ -73,12 +73,30 @@ public String getMonth() {
73
73
/**
74
74
* Returns the birthyear of the Fodselsnummer
75
75
*
76
- * @return A String containing the year of birth.
76
+ * @return a String containg the year of birth represented by 2 (two) digits. Century is not included.
77
+ */
78
+ public String getYear () {
79
+ return get2DigitBirthYear ();
80
+ }
81
+
82
+ /**
83
+ * Returns the birthyear of the Fodselsnummer
84
+ *
85
+ * @return A String containing the year of birth represented by 4 (four) digits. Century is included.
86
+ * @deprecated For removal - After 1.1.2032 we cannot reliably conclude correct century anymore.
87
+ * <a href="https://skatteetaten.github.io/folkeregisteret-api-dokumentasjon/nytt-fodselsnummer-fra-2032/">Nytt fødselsnummer fra 2032</a>
88
+ * replaced by {@link #getYear()}
77
89
*/
90
+ @ Deprecated
78
91
public String getBirthYear () {
79
92
return getCentury () + get2DigitBirthYear ();
80
93
}
81
94
95
+ /**
96
+ * @deprecated For removal - After 1.1.2032 we cannot reliably conclude correct century anymore.
97
+ * <a href="https://skatteetaten.github.io/folkeregisteret-api-dokumentasjon/nytt-fodselsnummer-fra-2032/">Nytt fødselsnummer fra 2032</a>
98
+ */
99
+ @ Deprecated
82
100
String getCentury () {
83
101
String result = null ;
84
102
int individnummerInt = Integer .parseInt (getIndividnummer ());
@@ -152,9 +170,12 @@ public String getIndividnummer() {
152
170
153
171
/**
154
172
* Returns the digit that decides the gender - the 9th in the Fodselsnummer.
155
- *
173
+ *
174
+ * @deprecated For removal - Gender will stop working after 1.1.2032
175
+ * <a href="https://skatteetaten.github.io/folkeregisteret-api-dokumentasjon/nytt-fodselsnummer-fra-2032/">Nytt fødselsnummer fra 2032</a>
156
176
* @return The digit.
157
177
*/
178
+ @ Deprecated
158
179
public int getGenderDigit () {
159
180
return getAt (8 );
160
181
}
@@ -179,18 +200,24 @@ public int getChecksumDigit2() {
179
200
180
201
/**
181
202
* Returns true if the Fodselsnummer represents a man.
182
- *
203
+ *
204
+ * @deprecated For removal - Gender will stop working after 1.1.2032
205
+ * <a href="https://skatteetaten.github.io/folkeregisteret-api-dokumentasjon/nytt-fodselsnummer-fra-2032/">Nytt fødselsnummer fra 2032</a>
183
206
* @return true or false.
184
207
*/
208
+ @ Deprecated
185
209
public boolean isMale () {
186
210
return getGenderDigit () % 2 != 0 ;
187
211
}
188
212
189
213
/**
190
214
* Returns true if the Fodselsnummer represents a woman.
191
- *
215
+ *
216
+ * @deprecated For removal - Gender will stop working after 1.1.2032
217
+ * <a href="https://skatteetaten.github.io/folkeregisteret-api-dokumentasjon/nytt-fodselsnummer-fra-2032/">Nytt fødselsnummer fra 2032</a>
192
218
* @return true or false.
193
219
*/
220
+ @ Deprecated
194
221
public boolean isFemale () {
195
222
return !isMale ();
196
223
}
@@ -264,6 +291,11 @@ private static int getThirdDigit(String fodselsnummer) {
264
291
return Integer .parseInt (fodselsnummer .substring (2 , 3 ));
265
292
}
266
293
294
+ /**
295
+ * @deprecated For removal - Gender will stop working after 1.1.2032
296
+ * <a href="https://skatteetaten.github.io/folkeregisteret-api-dokumentasjon/nytt-fodselsnummer-fra-2032/">Nytt fødselsnummer fra 2032</a>
297
+ */
298
+ @ Deprecated
267
299
public KJONN getKjonn () {
268
300
if (isFemale ()) {
269
301
return KJONN .KVINNE ;
0 commit comments