Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
526a0b92
Commit
526a0b92
authored
Aug 12, 2021
by
Piotr Gawron
Browse files
unused class removed
parent
816aadd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
rest-api/src/main/java/lcsb/mapviewer/api/SerializationUtils.java
deleted
100644 → 0
View file @
816aadd2
package
lcsb.mapviewer.api
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
lcsb.mapviewer.services.QueryException
;
public
class
SerializationUtils
{
private
static
Logger
logger
=
LogManager
.
getLogger
();
public
static
Integer
parseInteger
(
Object
value
,
String
fieldName
)
throws
QueryException
{
if
(
value
instanceof
Integer
)
{
return
(
Integer
)
value
;
}
else
if
(
value
instanceof
Double
)
{
logger
.
warn
(
"Double will be trunceted to int: "
+
value
);
return
((
Double
)
value
).
intValue
();
}
else
if
(
value
==
null
)
{
return
null
;
}
else
if
(
value
instanceof
String
)
{
if
(((
String
)
value
).
equalsIgnoreCase
(
""
))
{
return
null
;
}
else
{
try
{
return
Integer
.
parseInt
((
String
)
value
);
}
catch
(
NumberFormatException
e
)
{
throw
new
QueryException
(
"Invalid "
+
fieldName
+
" value: "
+
value
);
}
}
}
else
{
throw
new
QueryException
(
"Invalid "
+
fieldName
+
" value: "
+
value
);
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment