Package com.orbitz.consul.model.agent
Class ImmutableAgent
- java.lang.Object
-
- com.orbitz.consul.model.agent.Agent
-
- com.orbitz.consul.model.agent.ImmutableAgent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableAgent.BuilderBuilds instances of typeImmutableAgent.
-
Method Summary
Modifier and Type Method Description static ImmutableAgent.Builderbuilder()Creates a builder forImmutableAgent.static ImmutableAgentcopyOf(Agent instance)Creates an immutable copy of aAgentvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableAgentthat have equal attribute values.ConfiggetConfig()DebugConfiggetDebugConfig()MembergetMember()inthashCode()Computes a hash code from attributes:config,debugConfig,member.java.lang.StringtoString()Prints the immutable valueAgentwith attribute values.ImmutableAgentwithConfig(Config value)Copy the current immutable object by setting a value for theconfigattribute.ImmutableAgentwithDebugConfig(DebugConfig value)Copy the current immutable object by setting a value for thedebugConfigattribute.ImmutableAgentwithMember(Member value)Copy the current immutable object by setting a value for thememberattribute.
-
-
-
Method Detail
-
getConfig
public Config getConfig()
-
getDebugConfig
@Nullable public DebugConfig getDebugConfig()
- Specified by:
getDebugConfigin classAgent- Returns:
- The value of the
debugConfigattribute
-
getMember
public Member getMember()
-
withConfig
public final ImmutableAgent withConfig(Config value)
Copy the current immutable object by setting a value for theconfigattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for config- Returns:
- A modified copy of the
thisobject
-
withDebugConfig
public final ImmutableAgent withDebugConfig(@Nullable DebugConfig value)
Copy the current immutable object by setting a value for thedebugConfigattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for debugConfig (can benull)- Returns:
- A modified copy of the
thisobject
-
withMember
public final ImmutableAgent withMember(Member value)
Copy the current immutable object by setting a value for thememberattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for member- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableAgentthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:config,debugConfig,member.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueAgentwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableAgent copyOf(Agent instance)
Creates an immutable copy of aAgentvalue. 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 forImmutableAgent.ImmutableAgent.builder() .config(com.orbitz.consul.model.agent.Config) // requiredconfig.debugConfig(com.orbitz.consul.model.agent.DebugConfig | null) // nullabledebugConfig.member(com.orbitz.consul.model.agent.Member) // requiredmember.build();- Returns:
- A new ImmutableAgent builder
-
-