Package io.resys.hdes.client.api
Class ImmutableCacheEntry
java.lang.Object
io.resys.hdes.client.api.ImmutableCacheEntry
- All Implemented Interfaces:
HdesCache.CacheEntry,Serializable
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableCacheEntry
extends Object
implements HdesCache.CacheEntry
Immutable implementation of
HdesCache.CacheEntry.
Use the builder to create immutable instances:
ImmutableCacheEntry.builder().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableCacheEntry. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableCacheEntry.Builderbuilder()Creates a builder forImmutableCacheEntry.static ImmutableCacheEntrycopyOf(HdesCache.CacheEntry instance) Creates an immutable copy of aHdesCache.CacheEntryvalue.booleanThis instance is equal to all instances ofImmutableCacheEntrythat have equal attribute values.getAst()getId()inthashCode()Computes a hash code from attributes:id,source,ast,program.toString()Prints the immutable valueCacheEntrywith attribute values.final ImmutableCacheEntryCopy the current immutable object by setting a value for theastattribute.final ImmutableCacheEntryCopy the current immutable object by setting a value for theidattribute.final ImmutableCacheEntrywithProgram(Program value) Copy the current immutable object by setting a present value for the optionalprogramattribute.final ImmutableCacheEntrywithProgram(Optional<? extends Program> optional) Copy the current immutable object by setting an optional value for theprogramattribute.final ImmutableCacheEntrywithSource(AstBody.AstSource value) Copy the current immutable object by setting a value for thesourceattribute.
-
Method Details
-
getId
- Specified by:
getIdin interfaceHdesCache.CacheEntry- Returns:
- The value of the
idattribute
-
getSource
- Specified by:
getSourcein interfaceHdesCache.CacheEntry- Returns:
- The value of the
sourceattribute
-
getAst
- Specified by:
getAstin interfaceHdesCache.CacheEntry- Returns:
- The value of the
astattribute
-
getProgram
- Specified by:
getProgramin interfaceHdesCache.CacheEntry- Returns:
- The value of the
programattribute
-
withId
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
-
withSource
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
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
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
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
This instance is equal to all instances ofImmutableCacheEntrythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,source,ast,program. -
toString
Prints the immutable valueCacheEntrywith attribute values. -
copyOf
Creates an immutable copy of aHdesCache.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
Creates a builder forImmutableCacheEntry.ImmutableCacheEntry.builder() .id(String) // requiredid.source(io.resys.hdes.client.api.ast.AstBody.AstSource) // requiredsource.ast(io.resys.hdes.client.api.ast.AstBody) // requiredast.program(io.resys.hdes.client.api.programs.Program) // optionalprogram.build();- Returns:
- A new ImmutableCacheEntry builder
-