Skip to content

Commit a0b2f0a

Browse files
committed
fix(javadoc): fix duplicate @OverRide + pending CVRMastercard/Currency/CryptographicServiceMessage docs
1 parent 40a04ff commit a0b2f0a

File tree

3 files changed

+172
-4
lines changed

3 files changed

+172
-4
lines changed

jpos/src/main/java/org/jpos/emv/CVRMastercard.java

Lines changed: 132 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public class CVRMastercard implements Loggeable {
3232
private final byte[] cvr;
3333

3434
/**
35-
*
36-
* @param cvr Byte array containing the CVR value.
35+
* Creates a CVRMastercard from raw bytes.
36+
* @param cvr byte array containing the CVR value (must be 6 bytes)
3737
*/
3838
public CVRMastercard(byte[] cvr) {
3939
Objects.requireNonNull("cvr", "CVR cannot be null.");
@@ -44,8 +44,8 @@ public CVRMastercard(byte[] cvr) {
4444
}
4545

4646
/**
47-
*
48-
* @param cvr Hexadecimal string representation of the CVR value.
47+
* Creates a CVRMastercard from a hex string.
48+
* @param cvr hexadecimal string representation (must be 12 chars)
4949
*/
5050
public CVRMastercard(String cvr) {
5151
Objects.requireNonNull("cvr", "CVR cannot be null.");
@@ -56,70 +56,138 @@ public CVRMastercard(String cvr) {
5656
this.cvr = ISOUtil.hex2byte(cvr);
5757
}
5858

59+
/**
60+
* Returns true if aac returned in second generate a c.
61+
* @return true if condition applies
62+
*/
5963
public boolean aacReturnedInSecondGenerateAC() {
6064
return !isBitOn(cvr[0], 8) && !isBitOn(cvr[0], 7);
6165
}
6266

67+
/**
68+
* Returns true if aac returned in first generate a c.
69+
* @return true if condition applies
70+
*/
6371
public boolean aacReturnedInFirstGenerateAC() {
6472
return !isBitOn(cvr[0], 6) && !isBitOn(cvr[0], 5);
6573
}
6674

75+
/**
76+
* Returns true if tc returned in second generate a c.
77+
* @return true if condition applies
78+
*/
6779
public boolean tcReturnedInSecondGenerateAC() {
6880
return !isBitOn(cvr[0], 8) && isBitOn(cvr[0], 7);
6981
}
7082

83+
/**
84+
* Returns true if arqc returned in first generate a c.
85+
* @return true if condition applies
86+
*/
7187
public boolean arqcReturnedInFirstGenerateAC() {
7288
return isBitOn(cvr[0], 6) && !isBitOn(cvr[0], 5);
7389
}
7490

91+
/**
92+
* Returns true if tc returned in first generate a c.
93+
* @return true if condition applies
94+
*/
7595
public boolean tcReturnedInFirstGenerateAC() {
7696
return !isBitOn(cvr[0], 6) && isBitOn(cvr[0], 5);
7797
}
7898

99+
/**
100+
* Returns true if offline p i n verification performed.
101+
* @return true if condition applies
102+
*/
79103
public boolean offlinePINVerificationPerformed() {
80104
return isBitOn(cvr[0], 3);
81105
}
82106

107+
/**
108+
* Returns true if offline p i n verification not performed.
109+
* @return true if condition applies
110+
*/
83111
public boolean offlinePINVerificationNotPerformed() {
84112
return isBitOn(cvr[3], 6);
85113
}
86114

115+
/**
116+
* Returns true if dda returned.
117+
* @return true if condition applies
118+
*/
87119
public boolean ddaReturned() {
88120
return isBitOn(cvr[1], 8);
89121
}
90122

123+
/**
124+
* Returns true if combined d d a a c generation returned in first generate a c.
125+
* @return true if condition applies
126+
*/
91127
public boolean combinedDDAACGenerationReturnedInFirstGenerateAC() {
92128
return isBitOn(cvr[1], 7);
93129
}
94130

131+
/**
132+
* Returns true if combined d d a a c generation returned in second generate a c.
133+
* @return true if condition applies
134+
*/
95135
public boolean combinedDDAACGenerationReturnedInSecondGenerateAC() {
96136
return isBitOn(cvr[1], 6);
97137
}
98138

139+
/**
140+
* Returns true if issuer authentication failed.
141+
* @return true if condition applies
142+
*/
99143
public boolean issuerAuthenticationFailed() {
100144
return isBitOn(cvr[4], 3);
101145
}
102146

147+
/**
148+
* Returns true if script received.
149+
* @return true if condition applies
150+
*/
103151
public boolean scriptReceived() {
104152
return isBitOn(cvr[4], 2);
105153
}
106154

155+
/**
156+
* Returns true if script failed.
157+
* @return true if condition applies
158+
*/
107159
public boolean scriptFailed() {
108160
return isBitOn(cvr[4], 1);
109161
}
110162

163+
/**
164+
* Returns true if ciac default skipped on c a t3.
165+
* @return true if condition applies
166+
*/
111167
public boolean ciacDefaultSkippedOnCAT3() {
112168
return isBitOn(cvr[1], 4);
113169
}
114170

171+
/**
172+
* Returns true if match found in additional check table.
173+
* @return true if condition applies
174+
*/
115175
public boolean matchFoundInAdditionalCheckTable() {
116176
return isBitOn(cvr[5], 2);
117177
}
118178

179+
/**
180+
* Returns true if no match found in additional check table.
181+
* @return true if condition applies
182+
*/
119183
public boolean noMatchFoundInAdditionalCheckTable() {
120184
return isBitOn(cvr[5], 1);
121185
}
122186

187+
/**
188+
* Returns the right nibble of script counter.
189+
* @return the value
190+
*/
123191
public int rightNibbleOfScriptCounter() {
124192
StringBuilder sb = new StringBuilder();
125193
sb.append(isBitOn(cvr[2], 8) ? "1" : "0");
@@ -129,6 +197,10 @@ public int rightNibbleOfScriptCounter() {
129197
return Integer.parseInt(sb.toString(), 2);
130198
}
131199

200+
/**
201+
* Returns the right nibble of p i n try counter.
202+
* @return the value
203+
*/
132204
public int rightNibbleOfPINTryCounter() {
133205
StringBuilder sb = new StringBuilder();
134206
sb.append(isBitOn(cvr[2], 4) ? "1" : "0");
@@ -138,58 +210,114 @@ public int rightNibbleOfPINTryCounter() {
138210
return Integer.parseInt(sb.toString(), 2);
139211
}
140212

213+
/**
214+
* Returns true if offline p i n verification failed.
215+
* @return true if condition applies
216+
*/
141217
public boolean offlinePINVerificationFailed() {
142218
return isBitOn(cvr[0], 2);
143219
}
144220

221+
/**
222+
* Returns true if ptl exceeded.
223+
* @return true if condition applies
224+
*/
145225
public boolean ptlExceeded() {
146226
return isBitOn(cvr[0], 2);
147227
}
148228

229+
/**
230+
* Returns true if international transaction.
231+
* @return true if condition applies
232+
*/
149233
public boolean internationalTransaction() {
150234
return isBitOn(cvr[3], 3);
151235
}
152236

237+
/**
238+
* Returns true if domestic transaction.
239+
* @return true if condition applies
240+
*/
153241
public boolean domesticTransaction() {
154242
return isBitOn(cvr[3], 2);
155243
}
156244

245+
/**
246+
* Returns true if terminal erroneously considers offline p i n o k.
247+
* @return true if condition applies
248+
*/
157249
public boolean terminalErroneouslyConsidersOfflinePINOK() {
158250
return isBitOn(cvr[3], 1);
159251
}
160252

253+
/**
254+
* Returns true if lower consecutive offline limit exceeded.
255+
* @return true if condition applies
256+
*/
161257
public boolean lowerConsecutiveOfflineLimitExceeded() {
162258
return isBitOn(cvr[4], 8);
163259
}
164260

261+
/**
262+
* Returns true if upper consecutive offline limit exceeded.
263+
* @return true if condition applies
264+
*/
165265
public boolean upperConsecutiveOfflineLimitExceeded() {
166266
return isBitOn(cvr[4], 7);
167267
}
168268

269+
/**
270+
* Returns true if lower cumulative offline limit exceeded.
271+
* @return true if condition applies
272+
*/
169273
public boolean lowerCumulativeOfflineLimitExceeded() {
170274
return isBitOn(cvr[4], 6);
171275
}
172276

277+
/**
278+
* Returns true if upper cumulative offline limit exceeded.
279+
* @return true if condition applies
280+
*/
173281
public boolean upperCumulativeOfflineLimitExceeded() {
174282
return isBitOn(cvr[4], 5);
175283
}
176284

285+
/**
286+
* Returns true if go online on next transaction set.
287+
* @return true if condition applies
288+
*/
177289
public boolean goOnlineOnNextTransactionSet() {
178290
return isBitOn(cvr[4], 4);
179291
}
180292

293+
/**
294+
* Returns true if unable to go online.
295+
* @return true if condition applies
296+
*/
181297
public boolean unableToGoOnline() {
182298
return isBitOn(cvr[3], 7);
183299
}
184300

301+
/**
302+
* Returns true if second generate a c not requested.
303+
* @return true if condition applies
304+
*/
185305
public boolean secondGenerateACNotRequested() {
186306
return isBitOn(cvr[0], 8) && !isBitOn(cvr[0], 7);
187307
}
188308

309+
/**
310+
* Returns true if issuer authentication performed.
311+
* @return true if condition applies
312+
*/
189313
public boolean issuerAuthenticationPerformed() {
190314
return isBitOn(cvr[1], 5);
191315
}
192316

317+
/**
318+
* Returns true if offline encrypted p i n verification performed.
319+
* @return true if condition applies
320+
*/
193321
public boolean offlineEncryptedPINVerificationPerformed() {
194322
return isBitOn(cvr[0], 2);
195323
}

jpos/src/main/java/org/jpos/iso/Currency.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,58 @@
2929
*/
3030
public class Currency implements Serializable
3131
{
32+
/** ISO alpha currency code (e.g. "USD"). */
3233
String alphacode;
34+
/** ISO numeric currency code. */
3335
int isocode;
36+
/** Number of decimal places for this currency. */
3437
int numdecimals;
3538

39+
/**
40+
* Creates a Currency with the given code and decimal count.
41+
* @param alphacode ISO alpha code (e.g. "USD")
42+
* @param isocode ISO numeric code
43+
* @param numdecimals number of decimal places
44+
*/
3645
public Currency(String alphacode, int isocode, int numdecimals)
3746
{
3847
this.alphacode = alphacode;
3948
this.isocode = isocode;
4049
this.numdecimals = numdecimals;
4150
}
4251

52+
/**
53+
* Returns the number of decimal places for this currency.
54+
* @return decimal count
55+
*/
4356
public int getDecimals()
4457
{
4558
return numdecimals;
4659
}
4760

61+
/**
62+
* Returns the ISO numeric currency code.
63+
* @return ISO numeric code
64+
*/
4865
public int getIsoCode()
4966
{
5067
return isocode;
5168
}
5269

70+
/**
71+
* Returns the ISO alpha currency code.
72+
* @return alpha code (e.g. "USD")
73+
*/
5374
public String getAlphaCode()
5475
{
5576
return alphacode;
5677
}
5778

79+
/**
80+
* Formats an amount for inclusion in an ISO message (zero-padded, 12 digits).
81+
* @param amount the amount to format
82+
* @return 12-character zero-padded string
83+
*/
5884
public String formatAmountForISOMsg(double amount)
5985
{
6086
try

jpos/src/main/java/org/jpos/security/CryptographicServiceMessage.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,31 @@ public class CryptographicServiceMessage implements Loggeable {
4040
Map<String, String> fields = new LinkedHashMap<>();
4141
String mcl;
4242

43+
/** Message Class Label for RSI. */
4344
public static final String MCL_RSI = "RSI";
45+
/** Message Class Label for KSM (Key Service Message). */
4446
public static final String MCL_KSM = "KSM";
47+
/** Message Class Label for RSM. */
4548
public static final String MCL_RSM = "RSM";
49+
/** Message Class Label for ESM. */
4650
public static final String MCL_ESM = "ESM";
4751

52+
/** Tag name for Receiver. */
4853
public static final String TAG_RCV = "RCV";
54+
/** Tag name for Originator. */
4955
public static final String TAG_ORG = "ORG";
56+
/** Tag name for Server. */
5057
public static final String TAG_SVR = "SVR";
58+
/** Tag name for Key Data. */
5159
public static final String TAG_KD = "KD" ;
60+
/** Tag name for Clear Text PIN. */
5261
public static final String TAG_CTP = "CTP";
62+
/** Tag name for Counter. */
5363
public static final String TAG_CTR = "CTR";
64+
/** Tag name for Error Flag. */
5465
public static final String TAG_ERF = "ERF";
5566

67+
/** Exception thrown when CSM parsing fails. */
5668
public static class ParsingException extends Exception {
5769

5870
private static final long serialVersionUID = 6984718759445061L;
@@ -142,6 +154,7 @@ public String getFieldContent(String tag) {
142154
* This is the inverse of parse
143155
* @return the CSM in string format
144156
*/
157+
/** {@inheritDoc} */
145158
@Override
146159
public String toString() {
147160
StringBuilder csm = new StringBuilder();
@@ -167,6 +180,7 @@ public String toString() {
167180
* @see org.jpos.util.Loggeable
168181
*/
169182
@Override
183+
/** {@inheritDoc} */
170184
public void dump (PrintStream p, String indent) {
171185
String inner = indent + " ";
172186
p.print(indent + "<csm");

0 commit comments

Comments
 (0)