Package com.orbitz.consul.model.query
Class ImmutableQueryId
- java.lang.Object
-
- com.orbitz.consul.model.query.QueryId
-
- com.orbitz.consul.model.query.ImmutableQueryId
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableQueryId.BuilderBuilds instances of typeImmutableQueryId.
-
Method Summary
Modifier and Type Method Description static ImmutableQueryId.Builderbuilder()Creates a builder forImmutableQueryId.static ImmutableQueryIdcopyOf(QueryId instance)Creates an immutable copy of aQueryIdvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableQueryIdthat have equal attribute values.java.lang.StringgetId()inthashCode()Computes a hash code from attributes:id.java.lang.StringtoString()Prints the immutable valueQueryIdwith attribute values.ImmutableQueryIdwithId(java.lang.String value)Copy the current immutable object by setting a value for theidattribute.
-
-
-
Method Detail
-
getId
public java.lang.String getId()
-
withId
public final ImmutableQueryId withId(java.lang.String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableQueryIdthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:id.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueQueryIdwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableQueryId copyOf(QueryId instance)
Creates an immutable copy of aQueryIdvalue. 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 QueryId instance
-
builder
public static ImmutableQueryId.Builder builder()
Creates a builder forImmutableQueryId.ImmutableQueryId.builder() .id(String) // requiredid.build();- Returns:
- A new ImmutableQueryId builder
-
-