Package io.dialob.client.api
Class ImmutableCacheEntry
- java.lang.Object
-
- io.dialob.client.api.ImmutableCacheEntry
-
- All Implemented Interfaces:
DialobCache.CacheEntry,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableCacheEntry extends Object implements DialobCache.CacheEntry
Immutable implementation ofDialobCache.CacheEntry.Use the builder to create immutable instances:
ImmutableCacheEntry.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableCacheEntry.BuilderBuilds instances of typeImmutableCacheEntry.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableCacheEntry.Builderbuilder()Creates a builder forImmutableCacheEntry.static ImmutableCacheEntrycopyOf(DialobCache.CacheEntry instance)Creates an immutable copy of aDialobCache.CacheEntryvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableCacheEntrythat have equal attribute values.DialobDocumentgetAst()StringgetId()Optional<DialobProgram>getProgram()StringgetRev()DialobStore.StoreEntitygetSource()inthashCode()Computes a hash code from attributes:id,rev,source,ast,program.StringtoString()Prints the immutable valueCacheEntrywith attribute values.ImmutableCacheEntrywithAst(DialobDocument value)Copy the current immutable object by setting a value for theastattribute.ImmutableCacheEntrywithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableCacheEntrywithProgram(DialobProgram value)Copy the current immutable object by setting a present value for the optionalprogramattribute.ImmutableCacheEntrywithProgram(Optional<? extends DialobProgram> optional)Copy the current immutable object by setting an optional value for theprogramattribute.ImmutableCacheEntrywithRev(String value)Copy the current immutable object by setting a value for therevattribute.ImmutableCacheEntrywithSource(DialobStore.StoreEntity value)Copy the current immutable object by setting a value for thesourceattribute.
-
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceDialobCache.CacheEntry- Returns:
- The value of the
idattribute
-
getRev
public String getRev()
- Specified by:
getRevin interfaceDialobCache.CacheEntry- Returns:
- The value of the
revattribute
-
getSource
public DialobStore.StoreEntity getSource()
- Specified by:
getSourcein interfaceDialobCache.CacheEntry- Returns:
- The value of the
sourceattribute
-
getAst
public DialobDocument getAst()
- Specified by:
getAstin interfaceDialobCache.CacheEntry- Returns:
- The value of the
astattribute
-
getProgram
public Optional<DialobProgram> getProgram()
- Specified by:
getProgramin interfaceDialobCache.CacheEntry- Returns:
- The value of the
programattribute
-
withId
public final ImmutableCacheEntry withId(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
-
withRev
public final ImmutableCacheEntry withRev(String value)
Copy the current immutable object by setting a value for therevattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for rev- Returns:
- A modified copy of the
thisobject
-
withSource
public final ImmutableCacheEntry withSource(DialobStore.StoreEntity value)
Copy the current immutable object by setting a value for thesourceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for source- Returns:
- A modified copy of the
thisobject
-
withAst
public final ImmutableCacheEntry withAst(DialobDocument value)
Copy the current immutable object by setting a value for theastattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ast- Returns:
- A modified copy of the
thisobject
-
withProgram
public final ImmutableCacheEntry withProgram(DialobProgram value)
Copy the current immutable object by setting a present value for the optionalprogramattribute.- Parameters:
value- The value for program- Returns:
- A modified copy of
thisobject
-
withProgram
public final ImmutableCacheEntry withProgram(Optional<? extends DialobProgram> optional)
Copy the current immutable object by setting an optional value for theprogramattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for program- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableCacheEntrythat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,rev,source,ast,program.
-
toString
public String toString()
Prints the immutable valueCacheEntrywith attribute values.
-
copyOf
public static ImmutableCacheEntry copyOf(DialobCache.CacheEntry instance)
Creates an immutable copy of aDialobCache.CacheEntryvalue. 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 CacheEntry instance
-
builder
public static ImmutableCacheEntry.Builder builder()
Creates a builder forImmutableCacheEntry.ImmutableCacheEntry.builder() .id(String) // requiredid.rev(String) // requiredrev.source(io.dialob.client.api.DialobStore.StoreEntity) // requiredsource.ast(io.dialob.client.api.DialobDocument) // requiredast.program(io.dialob.program.DialobProgram) // optionalprogram.build();- Returns:
- A new ImmutableCacheEntry builder
-
-