All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.breuninger.boot.jobs.domain.JobMessage Maven / Gradle / Ivy

There is a newer version: 2.0.5.RELEASE
Show newest version
package com.breuninger.boot.jobs.domain;

import java.time.OffsetDateTime;
import java.time.temporal.ChronoUnit;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

@Getter
@EqualsAndHashCode
@ToString
public final class JobMessage {

  private final Level level;
  private final String message;
  private final OffsetDateTime timestamp;

  private JobMessage(final Level level, final String message, final OffsetDateTime timestamp) {
    this.level = level;
    this.message = message;
    this.timestamp = timestamp != null ? timestamp.truncatedTo(ChronoUnit.MILLIS) : null;
  }

  public static JobMessage jobMessage(final Level level, final String message, final OffsetDateTime ts) {
    return new JobMessage(level, message, ts);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy