Package io.resys.hdes.client.api
Class ImmutableCacheEntry.Builder
java.lang.Object
io.resys.hdes.client.api.ImmutableCacheEntry.Builder
- Enclosing class:
- ImmutableCacheEntry
Builds instances of type
ImmutableCacheEntry.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionInitializes the value for theastattribute.build()Builds a newImmutableCacheEntry.from(HdesCache.CacheEntry instance) Fill a builder with attribute values from the providedCacheEntryinstance.Initializes the value for theidattribute.Initializes the optional valueprogramto program.Initializes the optional valueprogramto program.source(AstBody.AstSource source) Initializes the value for thesourceattribute.
-
Method Details
-
from
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
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
source
Initializes the value for thesourceattribute.- Parameters:
source- The value for source- Returns:
thisbuilder for use in a chained invocation
-
ast
Initializes the value for theastattribute.- Parameters:
ast- The value for ast- Returns:
thisbuilder for use in a chained invocation
-
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 Program> program) Initializes the optional valueprogramto program.- Parameters:
program- The value for program- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableCacheEntry.- Returns:
- An immutable instance of CacheEntry
- Throws:
IllegalStateException- if any required attributes are missing
-