Class JavaTimeFormatter

  • Direct Known Subclasses:
    ApiClient

    @Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
               date="2023-02-27T13:53:41.971284Z[Etc/UTC]")
    public class JavaTimeFormatter
    extends java.lang.Object
    Class that add parsing/formatting support for Java 8+ OffsetDateTime class. It's generated for java clients when AbstractJavaCodegen#dateLibrary specified as java8.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String formatOffsetDateTime​(java.time.OffsetDateTime offsetDateTime)
      Format the given OffsetDateTime object into string.
      java.time.format.DateTimeFormatter getOffsetDateTimeFormatter()
      Get the date format used to parse/format OffsetDateTime parameters.
      java.time.OffsetDateTime parseOffsetDateTime​(java.lang.String str)
      Parse the given string into OffsetDateTime object.
      void setOffsetDateTimeFormatter​(java.time.format.DateTimeFormatter offsetDateTimeFormatter)
      Set the date format used to parse/format OffsetDateTime parameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JavaTimeFormatter

        public JavaTimeFormatter()
    • Method Detail

      • getOffsetDateTimeFormatter

        public java.time.format.DateTimeFormatter getOffsetDateTimeFormatter()
        Get the date format used to parse/format OffsetDateTime parameters.
        Returns:
        DateTimeFormatter
      • setOffsetDateTimeFormatter

        public void setOffsetDateTimeFormatter​(java.time.format.DateTimeFormatter offsetDateTimeFormatter)
        Set the date format used to parse/format OffsetDateTime parameters.
        Parameters:
        offsetDateTimeFormatter - DateTimeFormatter
      • parseOffsetDateTime

        public java.time.OffsetDateTime parseOffsetDateTime​(java.lang.String str)
        Parse the given string into OffsetDateTime object.
        Parameters:
        str - String
        Returns:
        OffsetDateTime
      • formatOffsetDateTime

        public java.lang.String formatOffsetDateTime​(java.time.OffsetDateTime offsetDateTime)
        Format the given OffsetDateTime object into string.
        Parameters:
        offsetDateTime - OffsetDateTime
        Returns:
        OffsetDateTime in string format