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

org.infinispan.configuration.global.ShutdownConfigurationBuilder Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.configuration.global;

import org.infinispan.commons.configuration.Builder;

public class ShutdownConfigurationBuilder extends AbstractGlobalConfigurationBuilder implements Builder {

   private ShutdownHookBehavior shutdownHookBehavior = ShutdownHookBehavior.DEFAULT;

   ShutdownConfigurationBuilder(GlobalConfigurationBuilder globalConfig) {
      super(globalConfig);
   }

   public ShutdownConfigurationBuilder hookBehavior(ShutdownHookBehavior hookBehavior) {
      this.shutdownHookBehavior = hookBehavior;
      return this;
   }

   @Override
   public
   void validate() {
      // No-op, no validation required
   }

   @Override
   public
   ShutdownConfiguration create() {
      return new ShutdownConfiguration(shutdownHookBehavior);
   }

   @Override
   public
   ShutdownConfigurationBuilder read(ShutdownConfiguration template) {
      this.shutdownHookBehavior = template.hookBehavior();

      return this;
   }

   @Override
   public String toString() {
      return "ShutdownConfigurationBuilder{" +
            "shutdownHookBehavior=" + shutdownHookBehavior +
            '}';
   }

   @Override
   public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;

      ShutdownConfigurationBuilder that = (ShutdownConfigurationBuilder) o;

      if (shutdownHookBehavior != that.shutdownHookBehavior) return false;

      return true;
   }

   @Override
   public int hashCode() {
      return shutdownHookBehavior != null ? shutdownHookBehavior.hashCode() : 0;
   }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy