Package com.orbitz.consul.model.event
Class ImmutableEvent
- java.lang.Object
-
- com.orbitz.consul.model.event.Event
-
- com.orbitz.consul.model.event.ImmutableEvent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableEvent.BuilderBuilds instances of typeImmutableEvent.
-
Method Summary
Modifier and Type Method Description static ImmutableEvent.Builderbuilder()Creates a builder forImmutableEvent.static ImmutableEventcopyOf(Event instance)Creates an immutable copy of aEventvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableEventthat have equal attribute values.java.lang.StringgetId()java.lang.LonggetLTime()java.lang.StringgetName()java.util.Optional<java.lang.String>getNodeFilter()java.util.Optional<java.lang.String>getPayload()java.util.Optional<java.lang.String>getServiceFilter()java.util.Optional<java.lang.String>getTagFilter()intgetVersion()inthashCode()Computes a hash code from attributes:id,name,payload,nodeFilter,serviceFilter,tagFilter,version,lTime.java.lang.StringtoString()Prints the immutable valueEventwith attribute values.ImmutableEventwithId(java.lang.String value)Copy the current immutable object by setting a value for theidattribute.ImmutableEventwithLTime(java.lang.Long value)Copy the current immutable object by setting a value for thelTimeattribute.ImmutableEventwithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableEventwithNodeFilter(java.lang.String value)Copy the current immutable object by setting a present value for the optionalnodeFilterattribute.ImmutableEventwithNodeFilter(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thenodeFilterattribute.ImmutableEventwithPayload(java.lang.String value)Copy the current immutable object by setting a present value for the optionalpayloadattribute.ImmutableEventwithPayload(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thepayloadattribute.ImmutableEventwithServiceFilter(java.lang.String value)Copy the current immutable object by setting a present value for the optionalserviceFilterattribute.ImmutableEventwithServiceFilter(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for theserviceFilterattribute.ImmutableEventwithTagFilter(java.lang.String value)Copy the current immutable object by setting a present value for the optionaltagFilterattribute.ImmutableEventwithTagFilter(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thetagFilterattribute.ImmutableEventwithVersion(int value)Copy the current immutable object by setting a value for theversionattribute.
-
-
-
Method Detail
-
getId
public java.lang.String getId()
-
getName
public java.lang.String getName()
-
getPayload
public java.util.Optional<java.lang.String> getPayload()
- Specified by:
getPayloadin classEvent- Returns:
- The value of the
payloadattribute
-
getNodeFilter
public java.util.Optional<java.lang.String> getNodeFilter()
- Specified by:
getNodeFilterin classEvent- Returns:
- The value of the
nodeFilterattribute
-
getServiceFilter
public java.util.Optional<java.lang.String> getServiceFilter()
- Specified by:
getServiceFilterin classEvent- Returns:
- The value of the
serviceFilterattribute
-
getTagFilter
public java.util.Optional<java.lang.String> getTagFilter()
- Specified by:
getTagFilterin classEvent- Returns:
- The value of the
tagFilterattribute
-
getVersion
public int getVersion()
- Specified by:
getVersionin classEvent- Returns:
- The value of the
versionattribute
-
getLTime
public java.lang.Long getLTime()
-
withId
public final ImmutableEvent 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
-
withName
public final ImmutableEvent withName(java.lang.String value)
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withPayload
public final ImmutableEvent withPayload(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalpayloadattribute.- Parameters:
value- The value for payload- Returns:
- A modified copy of
thisobject
-
withPayload
public final ImmutableEvent withPayload(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thepayloadattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for payload- Returns:
- A modified copy of
thisobject
-
withNodeFilter
public final ImmutableEvent withNodeFilter(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalnodeFilterattribute.- Parameters:
value- The value for nodeFilter- Returns:
- A modified copy of
thisobject
-
withNodeFilter
public final ImmutableEvent withNodeFilter(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thenodeFilterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for nodeFilter- Returns:
- A modified copy of
thisobject
-
withServiceFilter
public final ImmutableEvent withServiceFilter(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalserviceFilterattribute.- Parameters:
value- The value for serviceFilter- Returns:
- A modified copy of
thisobject
-
withServiceFilter
public final ImmutableEvent withServiceFilter(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for theserviceFilterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for serviceFilter- Returns:
- A modified copy of
thisobject
-
withTagFilter
public final ImmutableEvent withTagFilter(java.lang.String value)
Copy the current immutable object by setting a present value for the optionaltagFilterattribute.- Parameters:
value- The value for tagFilter- Returns:
- A modified copy of
thisobject
-
withTagFilter
public final ImmutableEvent withTagFilter(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thetagFilterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for tagFilter- Returns:
- A modified copy of
thisobject
-
withVersion
public final ImmutableEvent withVersion(int value)
Copy the current immutable object by setting a value for theversionattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for version- Returns:
- A modified copy of the
thisobject
-
withLTime
public final ImmutableEvent withLTime(java.lang.Long value)
Copy the current immutable object by setting a value for thelTimeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for lTime- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableEventthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,name,payload,nodeFilter,serviceFilter,tagFilter,version,lTime.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueEventwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableEvent copyOf(Event instance)
Creates an immutable copy of aEventvalue. 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 Event instance
-
builder
public static ImmutableEvent.Builder builder()
Creates a builder forImmutableEvent.ImmutableEvent.builder() .id(String) // requiredid.name(String) // requiredname.payload(String) // optionalpayload.nodeFilter(String) // optionalnodeFilter.serviceFilter(String) // optionalserviceFilter.tagFilter(String) // optionaltagFilter.version(int) // requiredversion.lTime(Long) // requiredlTime.build();- Returns:
- A new ImmutableEvent builder
-
-