Class ImmutableConfig

java.lang.Object
org.kiwiproject.consul.model.agent.Config
org.kiwiproject.consul.model.agent.ImmutableConfig

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableConfig extends Config
Immutable implementation of Config.

Use the builder to create immutable instances: ImmutableConfig.builder().

  • Method Details

    • getDatacenter

      public String getDatacenter()
      Specified by:
      getDatacenter in class Config
      Returns:
      The value of the datacenter attribute
    • getNodeName

      public String getNodeName()
      Specified by:
      getNodeName in class Config
      Returns:
      The value of the nodeName attribute
    • getRevision

      public String getRevision()
      Specified by:
      getRevision in class Config
      Returns:
      The value of the revision attribute
    • getServer

      public boolean getServer()
      Specified by:
      getServer in class Config
      Returns:
      The value of the server attribute
    • getVersion

      public String getVersion()
      Specified by:
      getVersion in class Config
      Returns:
      The value of the version attribute
    • withDatacenter

      public final ImmutableConfig withDatacenter(String value)
      Copy the current immutable object by setting a value for the datacenter attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for datacenter
      Returns:
      A modified copy of the this object
    • withNodeName

      public final ImmutableConfig withNodeName(String value)
      Copy the current immutable object by setting a value for the nodeName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for nodeName
      Returns:
      A modified copy of the this object
    • withRevision

      public final ImmutableConfig withRevision(String value)
      Copy the current immutable object by setting a value for the revision attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for revision
      Returns:
      A modified copy of the this object
    • withServer

      public final ImmutableConfig withServer(boolean value)
      Copy the current immutable object by setting a value for the server attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for server
      Returns:
      A modified copy of the this object
    • withVersion

      public final ImmutableConfig withVersion(String value)
      Copy the current immutable object by setting a value for the version attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for version
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableConfig that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: datacenter, nodeName, revision, server, version.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Config with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableConfig copyOf(Config instance)
      Creates an immutable copy of a Config value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable Config instance
    • builder

      public static ImmutableConfig.Builder builder()
      Creates a builder for ImmutableConfig.
       ImmutableConfig.builder()
          .datacenter(String) // required datacenter
          .nodeName(String) // required nodeName
          .revision(String) // required revision
          .server(boolean) // required server
          .version(String) // required version
          .build();
       
      Returns:
      A new ImmutableConfig builder