package com.airlock.iam.admin.application.service.logs;

import com.airlock.iam.admin.domain.model.logs.LogFileInfo;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public record LogSearchProperties(LogFileInfo logFile, int numberOfMessages, String filterPattern, LogSort sortBy, boolean sortAscending) {
   @SuppressFBWarnings(justification = "generated code")
   public static LogSearchProperties.LogSearchPropertiesBuilder builder() {
      return new LogSearchProperties.LogSearchPropertiesBuilder();
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class LogSearchPropertiesBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private LogFileInfo logFile;
      @SuppressFBWarnings(justification = "generated code")
      private int numberOfMessages;
      @SuppressFBWarnings(justification = "generated code")
      private String filterPattern;
      @SuppressFBWarnings(justification = "generated code")
      private LogSort sortBy;
      @SuppressFBWarnings(justification = "generated code")
      private boolean sortAscending;

      @SuppressFBWarnings(justification = "generated code")
      LogSearchPropertiesBuilder() {
      }

      @SuppressFBWarnings(justification = "generated code")
      public LogSearchProperties.LogSearchPropertiesBuilder logFile(LogFileInfo logFile) {
         this.logFile = logFile;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public LogSearchProperties.LogSearchPropertiesBuilder numberOfMessages(int numberOfMessages) {
         this.numberOfMessages = numberOfMessages;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public LogSearchProperties.LogSearchPropertiesBuilder filterPattern(String filterPattern) {
         this.filterPattern = filterPattern;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public LogSearchProperties.LogSearchPropertiesBuilder sortBy(LogSort sortBy) {
         this.sortBy = sortBy;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public LogSearchProperties.LogSearchPropertiesBuilder sortAscending(boolean sortAscending) {
         this.sortAscending = sortAscending;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public LogSearchProperties build() {
         return new LogSearchProperties(this.logFile, this.numberOfMessages, this.filterPattern, this.sortBy, this.sortAscending);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "LogSearchProperties.LogSearchPropertiesBuilder(logFile="
            + this.logFile
            + ", numberOfMessages="
            + this.numberOfMessages
            + ", filterPattern="
            + this.filterPattern
            + ", sortBy="
            + this.sortBy
            + ", sortAscending="
            + this.sortAscending
            + ")";
      }
   }
}
