Class JsonString

    • Constructor Summary

      Constructors 
      Constructor Description
      JsonString​(java.lang.String string)
      Creates new JSON string from given Java String.
      JsonString​(java.time.Duration duration)
      Creates new JSON string from given Duration.
      JsonString​(java.time.Instant instant)
      Creates new JSON string from given Instant.
      JsonString​(java.time.MonthDay monthDay)
      Creates new JSON string from given MonthDay.
      JsonString​(java.time.OffsetDateTime offsetDateTime)
      Creates new JSON string from given OffsetDateTime.
      JsonString​(java.time.OffsetTime offsetTime)
      Creates new JSON string from given OffsetTime.
      JsonString​(java.time.Period period)
      Creates new JSON string from given Period.
    • Constructor Detail

      • JsonString

        public JsonString​(java.lang.String string)
        Creates new JSON string from given Java String.
        Parameters:
        string - String.
      • JsonString

        public JsonString​(java.time.Duration duration)
        Creates new JSON string from given Duration.
        Parameters:
        duration - Duration.
      • JsonString

        public JsonString​(java.time.Instant instant)
        Creates new JSON string from given Instant.
        Parameters:
        instant - Instant.
      • JsonString

        public JsonString​(java.time.MonthDay monthDay)
        Creates new JSON string from given MonthDay.
        Parameters:
        monthDay - Month and day.
      • JsonString

        public JsonString​(java.time.OffsetDateTime offsetDateTime)
        Creates new JSON string from given OffsetDateTime.
        Parameters:
        offsetDateTime - Date and time with time zone offset.
      • JsonString

        public JsonString​(java.time.OffsetTime offsetTime)
        Creates new JSON string from given OffsetTime.
        Parameters:
        offsetTime - Time with time zone offset.
      • JsonString

        public JsonString​(java.time.Period period)
        Creates new JSON string from given Period.
        Parameters:
        period - Period.
    • Method Detail

      • toDuration

        public java.time.Duration toDuration()
        Returns:
        This JSON string converted to a Duration.
        Throws:
        java.time.format.DateTimeParseException - If this string does not contain a valid ISO8601 duration string.
      • toInstant

        public java.time.Instant toInstant()
        Returns:
        This JSON string converted to a Instant.
        Throws:
        java.time.format.DateTimeParseException - If this string does not contain a valid ISO8601 date and time string.
      • toMonthDay

        public java.time.MonthDay toMonthDay()
        Returns:
        This JSON string converted to a MonthDay.
        Throws:
        java.time.format.DateTimeParseException - If this string does not contain a valid ISO8601 month and day string.
      • toOffsetDateTime

        public java.time.OffsetDateTime toOffsetDateTime()
        Returns:
        This JSON string converted to a OffsetDateTime.
        Throws:
        java.time.format.DateTimeParseException - If this string does not contain a valid ISO8601 date and time string.
      • toOffsetTime

        public java.time.OffsetTime toOffsetTime()
        Returns:
        This JSON string converted to a OffsetTime.
        Throws:
        java.time.format.DateTimeParseException - If this string does not contain a valid ISO8601 time string.
      • toPeriod

        public java.time.Period toPeriod()
        Returns:
        This JSON string converted to a Period.
        Throws:
        java.time.format.DateTimeParseException - If this string does not contain a valid ISO8601 period string.
      • readJson

        public static JsonString readJson​(BinaryReader source)
                                   throws DtoReadException
        Reads JSON string from given source.
        Parameters:
        source - Source containing JSON string at the current read offset, ignoring any whitespace.
        Returns:
        Decoded JSON string.
        Throws:
        DtoReadException - If the source does not contain a valid JSON string at the current read offset, or if the source could not be read.
      • readJson

        public static JsonString readJson​(se.arkalix.internal.dto.json.JsonTokenBuffer buffer)
                                   throws DtoReadException
        Internal API. Might change in breaking ways between patch versions of the Kalix library. Use is not advised.
        Throws:
        DtoReadException
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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