Package com.orbitz.consul.model.query
Class ImmutableDnsQuery
- java.lang.Object
-
- com.orbitz.consul.model.query.DnsQuery
-
- com.orbitz.consul.model.query.ImmutableDnsQuery
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableDnsQuery.BuilderBuilds instances of typeImmutableDnsQuery.
-
Method Summary
Modifier and Type Method Description static ImmutableDnsQuery.Builderbuilder()Creates a builder forImmutableDnsQuery.static ImmutableDnsQuerycopyOf(DnsQuery instance)Creates an immutable copy of aDnsQueryvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableDnsQuerythat have equal attribute values.java.lang.StringgetTtl()inthashCode()Computes a hash code from attributes:ttl.java.lang.StringtoString()Prints the immutable valueDnsQuerywith attribute values.ImmutableDnsQuerywithTtl(java.lang.String value)Copy the current immutable object by setting a value for thettlattribute.
-
-
-
Method Detail
-
getTtl
public java.lang.String getTtl()
-
withTtl
public final ImmutableDnsQuery withTtl(java.lang.String value)
Copy the current immutable object by setting a value for thettlattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ttl- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableDnsQuerythat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:ttl.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueDnsQuerywith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableDnsQuery copyOf(DnsQuery instance)
Creates an immutable copy of aDnsQueryvalue. 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 DnsQuery instance
-
builder
public static ImmutableDnsQuery.Builder builder()
Creates a builder forImmutableDnsQuery.ImmutableDnsQuery.builder() .ttl(String) // requiredttl.build();- Returns:
- A new ImmutableDnsQuery builder
-
-