Package io.dialob.client.api
Class ImmutableCacheEntry.Builder
- java.lang.Object
-
- io.dialob.client.api.ImmutableCacheEntry.Builder
-
- Enclosing class:
- ImmutableCacheEntry
@NotThreadSafe public static final class ImmutableCacheEntry.Builder extends Object
Builds instances of typeImmutableCacheEntry. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableCacheEntry.Builderast(DialobDocument ast)Initializes the value for theastattribute.ImmutableCacheEntrybuild()Builds a newImmutableCacheEntry.ImmutableCacheEntry.Builderfrom(DialobCache.CacheEntry instance)Fill a builder with attribute values from the providedCacheEntryinstance.ImmutableCacheEntry.Builderid(String id)Initializes the value for theidattribute.ImmutableCacheEntry.Builderprogram(DialobProgram program)Initializes the optional valueprogramto program.ImmutableCacheEntry.Builderprogram(Optional<? extends DialobProgram> program)Initializes the optional valueprogramto program.ImmutableCacheEntry.Builderrev(String rev)Initializes the value for therevattribute.ImmutableCacheEntry.Buildersource(DialobStore.StoreEntity source)Initializes the value for thesourceattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableCacheEntry.Builder from(DialobCache.CacheEntry instance)
Fill a builder with attribute values from the providedCacheEntryinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableCacheEntry.Builder id(String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
rev
@CanIgnoreReturnValue public final ImmutableCacheEntry.Builder rev(String rev)
Initializes the value for therevattribute.- Parameters:
rev- The value for rev- Returns:
thisbuilder for use in a chained invocation
-
source
@CanIgnoreReturnValue public final ImmutableCacheEntry.Builder source(DialobStore.StoreEntity source)
Initializes the value for thesourceattribute.- Parameters:
source- The value for source- Returns:
thisbuilder for use in a chained invocation
-
ast
@CanIgnoreReturnValue public final ImmutableCacheEntry.Builder ast(DialobDocument ast)
Initializes the value for theastattribute.- Parameters:
ast- The value for ast- Returns:
thisbuilder for use in a chained invocation
-
program
@CanIgnoreReturnValue public final ImmutableCacheEntry.Builder program(DialobProgram program)
Initializes the optional valueprogramto program.- Parameters:
program- The value for program- Returns:
thisbuilder for chained invocation
-
program
@CanIgnoreReturnValue public final ImmutableCacheEntry.Builder program(Optional<? extends DialobProgram> program)
Initializes the optional valueprogramto program.- Parameters:
program- The value for program- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableCacheEntry build()
Builds a newImmutableCacheEntry.- Returns:
- An immutable instance of CacheEntry
- Throws:
IllegalStateException- if any required attributes are missing
-
-