Interface LogMessage

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Boolean getBoolean​(LogField logField)
      Retrieves the value of the specified field as a Boolean object.
      java.lang.Double getDouble​(LogField logField)
      Retrieves the value of the specified field as a Double value.
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getFields()
      Retrieves a map of the fields and their corresponding values in this log message.
      java.util.Date getGeneralizedTime​(LogField logField)
      Retrieves the value of the specified field as a Date object decoded from the generalized time format.
      java.lang.Integer getInteger​(LogField logField)
      Retrieves the value of the specified field as an Integer value.
      java.lang.Long getLong​(LogField logField)
      Retrieves the value of the specified field as a Long value.
      java.util.Date getRFC3339Timestamp​(LogField logField)
      Retrieves the value of the specified field as a Date object decoded from the ISO 8601 format described in RFC 3339.
      java.lang.String getString​(LogField logField)
      Retrieves the value of the specified field as a string.
      java.util.Date getTimestamp()
      Retrieves the timestamp for this log message.
      java.lang.String toString()
      Retrieves a string representation of this log message.
    • Method Detail

      • getTimestamp

        @NotNull
        java.util.Date getTimestamp()
        Retrieves the timestamp for this log message.
        Returns:
        The timestamp for this log message.
      • getFields

        @NotNull
        java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getFields()
        Retrieves a map of the fields and their corresponding values in this log message.
        Returns:
        A map of the fields and their corresponding values in this log message.
      • getBoolean

        @Nullable
        java.lang.Boolean getBoolean​(@NotNull
                                     LogField logField)
                              throws LogException
        Retrieves the value of the specified field as a Boolean object. If the field has multiple values, the first will be returned.
        Parameters:
        logField - The field for which to retrieve the Boolean value.
        Returns:
        The value of the specified field as a Boolean object, or null if the log message does not have the specified field.
        Throws:
        LogException - If the value of the specified field cannot be parsed as a Boolean.
      • getGeneralizedTime

        @Nullable
        java.util.Date getGeneralizedTime​(@NotNull
                                          LogField logField)
                                   throws LogException
        Retrieves the value of the specified field as a Date object decoded from the generalized time format. If the field has multiple values, the first will be returned.
        Parameters:
        logField - The field for which to retrieve the timestamp value.
        Returns:
        The value of the specified field as a Date object, or null if the log message does not have the specified field.
        Throws:
        LogException - If the value of the specified field cannot be parsed as a Date in the generalized time format.
      • getDouble

        @Nullable
        java.lang.Double getDouble​(@NotNull
                                   LogField logField)
                            throws LogException
        Retrieves the value of the specified field as a Double value. If the field has multiple values, the first will be returned.
        Parameters:
        logField - The field for which to retrieve the Double value.
        Returns:
        The value of the specified field as a Double value, or null if the log message does not have the specified field.
        Throws:
        LogException - If the value of the specified field cannot be parsed as a Double.
      • getInteger

        @Nullable
        java.lang.Integer getInteger​(@NotNull
                                     LogField logField)
                              throws LogException
        Retrieves the value of the specified field as an Integer value. If the field has multiple values, the first will be returned.
        Parameters:
        logField - The field for which to retrieve the Integer value.
        Returns:
        The Integer value of the specified field, or null if the log message does not have the specified field.
        Throws:
        LogException - If the value of the specified field cannot be parsed as an Integer.
      • getLong

        @Nullable
        java.lang.Long getLong​(@NotNull
                               LogField logField)
                        throws LogException
        Retrieves the value of the specified field as a Long value. If the field has multiple values, the first will be returned.
        Parameters:
        logField - The field for which to retrieve the Long value.
        Returns:
        The Long value of the specified field, or null if the log message does not have the specified field.
        Throws:
        LogException - If the value of the specified field cannot be parsed as a Long.
      • getRFC3339Timestamp

        @Nullable
        java.util.Date getRFC3339Timestamp​(@NotNull
                                           LogField logField)
                                    throws LogException
        Retrieves the value of the specified field as a Date object decoded from the ISO 8601 format described in RFC 3339. If the field has multiple values, the first will be returned.
        Parameters:
        logField - The field for which to retrieve the timestamp value.
        Returns:
        The value of the specified field as a Date object, or null if the log message does not have the specified field.
        Throws:
        LogException - If the value of the specified field cannot be parsed as a Date in the RFC 3339 format.
      • getString

        @Nullable
        java.lang.String getString​(@NotNull
                                   LogField logField)
        Retrieves the value of the specified field as a string. If the field has multiple values, the first will be returned.
        Parameters:
        logField - The field for which to retrieve the string value.
        Returns:
        The value of the specified field as a string, or null if the log message does not have the specified field.
      • toString

        @NotNull
        java.lang.String toString()
        Retrieves a string representation of this log message.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this log message.