Class ImmutableAgent

java.lang.Object
org.kiwiproject.consul.model.agent.Agent
org.kiwiproject.consul.model.agent.ImmutableAgent

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

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

  • Method Details

    • getConfig

      public Config getConfig()
      Specified by:
      getConfig in class Agent
      Returns:
      The value of the config attribute
    • getDebugConfig

      public @Nullable DebugConfig getDebugConfig()
      Specified by:
      getDebugConfig in class Agent
      Returns:
      The value of the debugConfig attribute
    • getMember

      public Member getMember()
      Specified by:
      getMember in class Agent
      Returns:
      The value of the member attribute
    • getMeta

      public com.google.common.collect.ImmutableMap<String,String> getMeta()
      Specified by:
      getMeta in class Agent
      Returns:
      The value of the meta attribute
    • withConfig

      public final ImmutableAgent withConfig(Config value)
      Copy the current immutable object by setting a value for the config attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for config
      Returns:
      A modified copy of the this object
    • withDebugConfig

      public final ImmutableAgent withDebugConfig(@Nullable DebugConfig value)
      Copy the current immutable object by setting a value for the debugConfig attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for debugConfig (can be null)
      Returns:
      A modified copy of the this object
    • withMember

      public final ImmutableAgent withMember(Member value)
      Copy the current immutable object by setting a value for the member attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for member
      Returns:
      A modified copy of the this object
    • withMeta

      public final ImmutableAgent withMeta(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the meta map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the meta map
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableAgent 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: config, debugConfig, member, meta.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableAgent copyOf(Agent instance)
      Creates an immutable copy of a Agent 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 Agent instance
    • builder

      public static ImmutableAgent.Builder builder()
      Creates a builder for ImmutableAgent.
       ImmutableAgent.builder()
          .config(org.kiwiproject.consul.model.agent.Config) // required config
          .debugConfig(org.kiwiproject.consul.model.agent.@org.checkerframework.checker.nullness.qual.Nullable DebugConfig | null) // nullable debugConfig
          .member(org.kiwiproject.consul.model.agent.Member) // required member
          .putMeta|putAllMeta(String => String) // meta mappings
          .build();
       
      Returns:
      A new ImmutableAgent builder