Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSCommon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSCommon
Commits
c3b7c74c
Commit
c3b7c74c
authored
9 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Added Date and Long parameters
parent
84ab67b9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/nibio/vips/util/DateMap.java
+54
-2
54 additions, 2 deletions
src/main/java/no/nibio/vips/util/DateMap.java
with
54 additions
and
2 deletions
src/main/java/no/nibio/vips/util/DateMap.java
+
54
−
2
View file @
c3b7c74c
...
@@ -131,8 +131,60 @@ public class DateMap {
...
@@ -131,8 +131,60 @@ public class DateMap {
{
{
return
(
Integer
)
this
.
getParamValueForDate
(
date
,
paramName
);
return
(
Integer
)
this
.
getParamValueForDate
(
date
,
paramName
);
}
}
catch
(
NullPointerException
ex
)
{
return
null
;
}
catch
(
NullPointerException
|
ClassCastException
ex
)
{
return
null
;
}
catch
(
ClassCastException
npe
)
{
return
null
;}
}
/**
* Set a parameter value of type Long for a given date
* @param date
* @param paramName
* @param value
*/
public
void
setParamLongValueForDate
(
Date
date
,
String
paramName
,
Long
value
)
{
this
.
setParamValueForDate
(
date
,
paramName
,
value
);
}
/**
*
* @param date
* @param paramName
* @return a parameter value of type Long for a given date
*/
public
Long
getParamLongValueForDate
(
Date
date
,
String
paramName
)
{
try
{
return
(
Long
)
this
.
getParamValueForDate
(
date
,
paramName
);
}
catch
(
NullPointerException
|
ClassCastException
ex
)
{
return
null
;
}
}
/**
* Set a parameter value of type Date for a given date
* @param date
* @param paramName
* @param value
*/
public
void
setParamDateValueForDate
(
Date
date
,
String
paramName
,
Date
value
)
{
this
.
setParamLongValueForDate
(
date
,
paramName
,
value
.
getTime
());
}
/**
*
* @param date
* @param paramName
* @return a parameter value of type Date for a given date
*/
public
Date
getParamDateValueForDate
(
Date
date
,
String
paramName
)
{
try
{
Long
dateVal
=
this
.
getParamLongValueForDate
(
date
,
paramName
);
return
new
Date
(
dateVal
);
}
catch
(
NullPointerException
|
ClassCastException
ex
)
{
return
null
;
}
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment