Terms of Service
|
Privacy Policy
|
Cookie Policy
Skip to content
GitLab
Explore
Sign in
Commits on Source (3)
Changed artifactId
· f8f309a6
Uwe Plonus
authored
Mar 18, 2019
f8f309a6
Added deploy to maven repository
· cd8feaeb
Uwe Plonus
authored
Mar 18, 2019
cd8feaeb
Documented Identifier
· e8b84225
Uwe Plonus
authored
Mar 18, 2019
e8b84225
Show whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
e8b84225
...
...
@@ -17,6 +17,16 @@ build:
script
:
-
mvn $MAVEN_CLI_OPTS clean package
deploy
:
stage
:
deploy
only
:
refs
:
-
master@sw4j-org/random-barcode
variables
:
-
$REPO_USER
script
:
-
mvn $MAVEN_CLI_OPTS deploy
pages
:
stage
:
deploy
only
:
...
...
pom.xml
View file @
e8b84225
...
...
@@ -2,8 +2,8 @@
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.sw4j.tool
.barcode
</groupId>
<artifactId>
random
</artifactId>
<groupId>
org.sw4j.tool
</groupId>
<artifactId>
random
-barcode
</artifactId>
<version>
0.1.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
...
...
src/main/java/org/sw4j/tool/barcode/random/generator/CodeGenerator.java
View file @
e8b84225
...
...
@@ -138,9 +138,9 @@ public class CodeGenerator {
Set
<
String
>
inputValues
=
new
LinkedHashSet
<>();
while
(
mappingIterator
.
hasNext
())
{
Identifier
ident
=
mappingIterator
.
next
();
if
(!
inputValues
.
add
(
ident
.
get
Value
()))
{
if
(!
inputValues
.
add
(
ident
.
get
Ident
()))
{
throw
new
IllegalArgumentException
(
String
.
format
(
"Duplicated input value '%s' found"
,
ident
.
get
Value
()));
String
.
format
(
"Duplicated input value '%s' found"
,
ident
.
get
Ident
()));
}
}
final
Set
<
RandomIdent
>
randomValues
=
createCodes
(
inputValues
,
encodings
);
...
...
src/main/java/org/sw4j/tool/barcode/random/input/Identifier.java
View file @
e8b84225
...
...
@@ -16,43 +16,46 @@
*/
package
org.sw4j.tool.barcode.random.input
;
import
com.fasterxml.jackson.annotation.JsonCreator
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.util.Objects
;
/**
*
* @author uwe
* <p>
* This class maps the input identifiers to Java objects.
* </p>
* <p>
* This class is immutable.
* </p>
* @author Uwe Plonus <u.plonus@gmail.com>
*/
public
class
Identifier
{
@JsonProperty
private
String
value
;
public
String
getValue
()
{
return
value
;
}
/**
* <p>
* The identifier value itself.
* </p>
*/
private
final
String
ident
;
@Override
public
int
hashCode
()
{
return
value
.
hashCode
();
/**
* <p>
* Create a new {@code Identifier} with the given {@code ident}.
* </p>
* @param ident the identifiers value.
*/
@JsonCreator
public
Identifier
(
@JsonProperty
(
"ident"
)
final
String
ident
)
{
this
.
ident
=
ident
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
{
return
true
;
}
if
(
obj
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
obj
.
getClass
())
{
return
false
;
}
final
Identifier
other
=
(
Identifier
)
obj
;
if
(!
Objects
.
equals
(
this
.
value
,
other
.
value
))
{
return
false
;
}
return
true
;
/**
* <p>
* The identifiers value.
* </p>
* @return the value.
*/
public
String
getIdent
()
{
return
ident
;
}
}
src/main/java/org/sw4j/tool/barcode/random/input/package-info.java
0 → 100644
View file @
e8b84225
/*
* Copyright (C) 2019 sw4j.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* <p>
* This package contains the input mapping.
* </p>
*/
package
org.sw4j.tool.barcode.random.input
;