package com.airlock.iam.admin.application.configuration.maintenancemessages;

import com.airlock.iam.plugin.api.annotation.config.Plugin;
import com.airlock.iam.plugin.api.annotation.property.StringProperty;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

@Plugin(description = "Configuration of a maintenance message location.", displayName = "Location")
public final class MaintenanceMessageLocation {
   private static final String LOCATION_PATTERN = "\\w+";
   @StringProperty(
      description = "<p>The name of this location displayed in the maintenance message editor of the Adminapp.</p><p><b>Note</b>: In order for the Loginapp to be able to retrieve the messages for the different locations, the same 'Location Name' also has to be configured in the Loginapp's maintenance message settings.</p>",
      exampleValues = {"bottom", "left", "right"},
      optional = false,
      validationRegex = "\\w+"
   )
   private String locationName;
   public static final String LOCATION_NAME_FIELD = "locationName";

   public String getLocationName() {
      return this.locationName;
   }

   @SuppressFBWarnings(justification = "generated code")
   public static MaintenanceMessageLocation.MaintenanceMessageLocationBuilder builder() {
      return new MaintenanceMessageLocation.MaintenanceMessageLocationBuilder();
   }

   @SuppressFBWarnings(justification = "generated code")
   public MaintenanceMessageLocation() {
   }

   @SuppressFBWarnings(justification = "generated code")
   public MaintenanceMessageLocation(String locationName) {
      this.locationName = locationName;
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class MaintenanceMessageLocationBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private String locationName;

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

      @SuppressFBWarnings(justification = "generated code")
      public MaintenanceMessageLocation.MaintenanceMessageLocationBuilder locationName(String locationName) {
         this.locationName = locationName;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public MaintenanceMessageLocation build() {
         return new MaintenanceMessageLocation(this.locationName);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "MaintenanceMessageLocation.MaintenanceMessageLocationBuilder(locationName=" + this.locationName + ")";
      }
   }
}
