[jackson-annotations] 171/207: Minor fixes to JsonFormat.Value accessors
Timo Aaltonen
tjaalton at moszumanska.debian.org
Sat Sep 6 13:55:51 UTC 2014
This is an automated email from the git hooks/post-receive script.
tjaalton pushed a commit to branch master
in repository jackson-annotations.
commit a25cc3d58b5588165b3b571b90ec61d9cc1143a4
Author: Tatu Saloranta <tatu.saloranta at iki.fi>
Date: Thu Mar 27 21:57:21 2014 -0700
Minor fixes to JsonFormat.Value accessors
---
.../fasterxml/jackson/annotation/JsonFormat.java | 27 ++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonFormat.java b/src/main/java/com/fasterxml/jackson/annotation/JsonFormat.java
index a0e9e92..99e5b6f 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonFormat.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonFormat.java
@@ -283,9 +283,36 @@ public @interface JsonFormat
public TimeZone getTimeZone() {
TimeZone tz = _timezone;
if (tz == null) {
+ if (timezoneStr == null) {
+ return null;
+ }
_timezone = tz = TimeZone.getTimeZone(timezoneStr);
}
return tz;
}
+
+ /**
+ * @since 2.4
+ */
+ public boolean hasShape() { return shape != Shape.ANY; }
+
+ /**
+ * @since 2.4
+ */
+ public boolean hasPattern() {
+ return (pattern != null) && (pattern.length() > 0);
+ }
+
+ /**
+ * @since 2.4
+ */
+ public boolean hasLocale() { return locale != null; }
+
+ /**
+ * @since 2.4
+ */
+ public boolean hasTimeZone() {
+ return (_timezone != null) || (timezoneStr != null && !timezoneStr.isEmpty());
+ }
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jackson-annotations.git
More information about the pkg-java-commits
mailing list