Class ImmutableTemplate
java.lang.Object
org.kiwiproject.consul.model.query.Template
org.kiwiproject.consul.model.query.ImmutableTemplate
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableTemplate
extends Template
Immutable implementation of
Template.
Use the builder to create immutable instances:
ImmutableTemplate.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableTemplate.Builderbuilder()Creates a builder forImmutableTemplate.static ImmutableTemplateCreates an immutable copy of aTemplatevalue.booleanThis instance is equal to all instances ofImmutableTemplatethat have equal attribute values.getType()inthashCode()Computes a hash code from attributes:type,regExp.toString()Prints the immutable valueTemplatewith attribute values.final ImmutableTemplatewithRegExp(String value) Copy the current immutable object by setting a present value for the optionalregExpattribute.final ImmutableTemplatewithRegExp(Optional<String> optional) Copy the current immutable object by setting an optional value for theregExpattribute.final ImmutableTemplateCopy the current immutable object by setting a value for thetypeattribute.
-
Method Details
-
getType
-
getRegExp
-
withType
Copy the current immutable object by setting a value for thetypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type- Returns:
- A modified copy of the
thisobject
-
withRegExp
Copy the current immutable object by setting a present value for the optionalregExpattribute.- Parameters:
value- The value for regExp- Returns:
- A modified copy of
thisobject
-
withRegExp
Copy the current immutable object by setting an optional value for theregExpattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for regExp- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableTemplatethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:type,regExp. -
toString
Prints the immutable valueTemplatewith attribute values. -
copyOf
Creates an immutable copy of aTemplatevalue. 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 Template instance
-
builder
Creates a builder forImmutableTemplate.ImmutableTemplate.builder() .type(String) // requiredtype.regExp(String) // optionalregExp.build();- Returns:
- A new ImmutableTemplate builder
-