Skip to content

Commit c42e65e

Browse files
author
=magma17
committed
fork repo and converse to java code
0 parents  commit c42e65e

22 files changed

+4056
-0
lines changed

.classpath

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
4+
<attributes>
5+
<attribute name="maven.pomderived" value="true"/>
6+
</attributes>
7+
</classpathentry>
8+
<classpathentry kind="src" output="target/classes" path="src/main/java">
9+
<attributes>
10+
<attribute name="optional" value="true"/>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
15+
<attributes>
16+
<attribute name="maven.pomderived" value="true"/>
17+
</attributes>
18+
</classpathentry>
19+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
20+
<attributes>
21+
<attribute name="maven.pomderived" value="true"/>
22+
</attributes>
23+
</classpathentry>
24+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
25+
<attributes>
26+
<attribute name="optional" value="true"/>
27+
<attribute name="maven.pomderived" value="true"/>
28+
<attribute name="test" value="true"/>
29+
</attributes>
30+
</classpathentry>
31+
<classpathentry kind="output" path="target/classes"/>
32+
</classpath>

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
.settings
3+
target
4+
bin

.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>com.nokieng17.emvcoqr</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
21+
<nature>org.eclipse.jdt.core.javanature</nature>
22+
</natures>
23+
</projectDescription>

pom.xml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
5+
6+
<!-- mvn install:install-file -Dfile="D:\LVB_DEV\LVB_FID\Sources\com.nokieng.crccalc.jar"
7+
-DgroupId="com.nokieng17" -DartifactId=crccalc -Dversion="1.0.0" -Dpackaging=jar
8+
-DgeneratePom=true -->
9+
10+
<modelVersion>4.0.0</modelVersion>
11+
<groupId>com.lvb.emvcoqr</groupId>
12+
<artifactId>com.lvb.emvcoqr</artifactId>
13+
<version>0.0.1</version>
14+
<name>EMVCO QR</name>
15+
<description>implementing EMVCO QR by magma17</description>
16+
17+
18+
19+
<properties>
20+
<javax.el.api.version>3.0.1-b06</javax.el.api.version>
21+
<hibernate.validator.version>6.0.16.Final</hibernate.validator.version>
22+
<bean.validation.api.version>2.0.1.Final</bean.validation.api.version>
23+
</properties>
24+
25+
<dependencies>
26+
27+
<!-- Java bean validation API - Spec -->
28+
<dependency>
29+
<groupId>javax.validation</groupId>
30+
<artifactId>validation-api</artifactId>
31+
<version>${bean.validation.api.version}</version>
32+
</dependency>
33+
34+
<!-- Hibernate validator - Bean validation API Implementation -->
35+
<dependency>
36+
<groupId>org.hibernate</groupId>
37+
<artifactId>hibernate-validator</artifactId>
38+
<version>${hibernate.validator.version}</version>
39+
</dependency>
40+
41+
<!-- Unified Expression Language - Spec -->
42+
<dependency>
43+
<groupId>javax.el</groupId>
44+
<artifactId>javax.el-api</artifactId>
45+
<version>${javax.el.api.version}</version>
46+
</dependency>
47+
48+
<dependency>
49+
<groupId>com.nokieng17</groupId>
50+
<artifactId>crccalc</artifactId>
51+
<version>1.0.0</version>
52+
</dependency>
53+
</dependencies>
54+
55+
<build>
56+
<plugins>
57+
<plugin>
58+
<artifactId>maven-compiler-plugin</artifactId>
59+
<version>3.8.0</version>
60+
<configuration>
61+
<source>1.8</source>
62+
<target>1.8</target>
63+
</configuration>
64+
</plugin>
65+
</plugins>
66+
</build>
67+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package com.nokieng17.emvcoqr;
2+
3+
import java.util.HashMap;
4+
5+
import javax.validation.constraints.NotNull;
6+
7+
import com.nokieng17.emvcoqr.validation.EmvSpecification;
8+
9+
public class MerchantAccountInformation {
10+
11+
@NotNull(message = "globalUniqueIdentifier is null")
12+
@EmvSpecification(Id = 0, MaxLength = 32, message = "length of globalUniqueIdentifier is exceed MaxLength")
13+
public String globalUniqueIdentifier;
14+
15+
public PaymentNetworkSpecifics paymentNetworkSpecifics;
16+
17+
public MerchantAccountInformation() {
18+
paymentNetworkSpecifics = new PaymentNetworkSpecifics();
19+
}
20+
21+
public String getGlobalUniqueIdentifier() {
22+
return globalUniqueIdentifier;
23+
}
24+
25+
public MerchantAccountInformation setGlobalUniqueIdentifier(String globalUniqueIdentifier) {
26+
this.globalUniqueIdentifier = globalUniqueIdentifier;
27+
return this;
28+
}
29+
30+
public HashMap<Integer, String> getPaymentNetworkSpecifics() {
31+
return paymentNetworkSpecifics;
32+
}
33+
34+
public MerchantAccountInformation addPaymentNetworkSpecifics(int key, String value) {
35+
this.validate(key, value);
36+
this.paymentNetworkSpecifics.put(key, value);
37+
return this;
38+
}
39+
40+
private void validate(int key, String value) {
41+
if (key < 1 || key > 99) {
42+
throw new IllegalArgumentException(
43+
String.format("%s %02d", "an paymentNetworkSpecific ID was in invalid ID range: ID", key)
44+
);
45+
}
46+
if (this.getPaymentNetworkSpecifics().containsKey(key)) {
47+
throw new IllegalArgumentException(
48+
String.format("%s %02d", "an paymentNetworkSpecific ID was duplicated: ID", key)
49+
);
50+
}
51+
}
52+
53+
public class PaymentNetworkSpecifics extends HashMap<Integer, String> {
54+
55+
/**
56+
*
57+
*/
58+
private static final long serialVersionUID = 7698382395951913113L;
59+
60+
public PaymentNetworkSpecifics() {
61+
super();
62+
}
63+
64+
}
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.nokieng17.emvcoqr;
2+
3+
import java.util.HashMap;
4+
5+
public class MerchantAccountInformationMap extends HashMap<Integer, MerchantAccountInformation> {
6+
7+
/**
8+
* HashMap serialVersionUID of MerchantAccountInformationMap
9+
*/
10+
private static final long serialVersionUID = -5759959864360899403L;
11+
12+
public MerchantAccountInformationMap() {
13+
super();
14+
}
15+
16+
public MerchantAccountInformationMap add(Integer key, MerchantAccountInformation value) {
17+
// TODO Auto-generated method stub
18+
super.put(key, value);
19+
return this;
20+
}
21+
22+
}

0 commit comments

Comments
 (0)