Class JsonFormat.Value

    • Constructor Detail

      • Value

        public Value()
      • Value

        public Value​(java.lang.String p,
                     JsonFormat.Shape sh,
                     java.lang.String localeStr,
                     java.lang.String tzStr,
                     JsonFormat.Features f,
                     java.lang.Boolean lenient)
        Since:
        2.9
      • Value

        public Value​(java.lang.String p,
                     JsonFormat.Shape sh,
                     java.util.Locale l,
                     java.util.TimeZone tz,
                     JsonFormat.Features f,
                     java.lang.Boolean lenient)
        Since:
        2.9
      • Value

        public Value​(java.lang.String p,
                     JsonFormat.Shape sh,
                     java.util.Locale l,
                     java.lang.String tzStr,
                     java.util.TimeZone tz,
                     JsonFormat.Features f,
                     java.lang.Boolean lenient)
        Since:
        2.9
      • Value

        @Deprecated
        public Value​(java.lang.String p,
                     JsonFormat.Shape sh,
                     java.util.Locale l,
                     java.lang.String tzStr,
                     java.util.TimeZone tz,
                     JsonFormat.Features f)
        Deprecated.
    • Method Detail

      • merge

        public static JsonFormat.Value merge​(JsonFormat.Value base,
                                             JsonFormat.Value overrides)
        Helper method that will try to combine values from two JsonFormat.Value instances, using one as base settings, and the other as overrides to use instead of base values when defined; base values are only use if override does not specify a value (matching value is null or logically missing). Note that one or both of value instances may be `null`, directly; if both are `null`, result will also be `null`; otherwise never null.
        Since:
        2.8
      • forPattern

        public static JsonFormat.Value forPattern​(java.lang.String p)
        Since:
        2.6
      • forLeniency

        public static JsonFormat.Value forLeniency​(boolean lenient)
        Since:
        2.9
      • withPattern

        public JsonFormat.Value withPattern​(java.lang.String p)
        Since:
        2.1
      • withLocale

        public JsonFormat.Value withLocale​(java.util.Locale l)
        Since:
        2.1
      • withTimeZone

        public JsonFormat.Value withTimeZone​(java.util.TimeZone tz)
        Since:
        2.1
      • withLenient

        public JsonFormat.Value withLenient​(java.lang.Boolean lenient)
        Since:
        2.9
      • getPattern

        public java.lang.String getPattern()
      • getLocale

        public java.util.Locale getLocale()
      • getLenient

        public java.lang.Boolean getLenient()
        Since:
        2.9
      • isLenient

        public boolean isLenient()
        Since:
        2.9
      • timeZoneAsString

        public java.lang.String timeZoneAsString()
        Alternate access (compared to getTimeZone()) which is useful when caller just wants time zone id to convert, but not as JDK provided TimeZone
        Since:
        2.4
      • getTimeZone

        public java.util.TimeZone getTimeZone()
      • hasShape

        public boolean hasShape()
        Since:
        2.4
      • hasPattern

        public boolean hasPattern()
        Since:
        2.4
      • hasLocale

        public boolean hasLocale()
        Since:
        2.4
      • hasTimeZone

        public boolean hasTimeZone()
        Since:
        2.4
      • hasLenient

        public boolean hasLenient()
        Accessor for checking whether there is a setting for leniency. NOTE: does NOT mean that `lenient` is `true` necessarily; just that it has been set.
        Since:
        2.9
      • getFeature

        public java.lang.Boolean getFeature​(JsonFormat.Feature f)
        Accessor for checking whether this format value has specific setting for given feature. Result is 3-valued with either `null`, Boolean.TRUE or Boolean.FALSE, indicating 'yes/no/dunno' choices, where `null` ("dunno") indicates that the default handling should be used based on global defaults, and there is no format override.
        Since:
        2.6
      • getFeatures

        public JsonFormat.Features getFeatures()
        Accessor for getting full set of features enabled/disabled.
        Since:
        2.8
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object