Class ImmutableCacheEntry

    • Method Detail

      • withId

        public final ImmutableCacheEntry withId​(String value)
        Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id
        Returns:
        A modified copy of the this object
      • withRev

        public final ImmutableCacheEntry withRev​(String value)
        Copy the current immutable object by setting a value for the rev attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for rev
        Returns:
        A modified copy of the this object
      • withSource

        public final ImmutableCacheEntry withSource​(DialobStore.StoreEntity value)
        Copy the current immutable object by setting a value for the source attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for source
        Returns:
        A modified copy of the this object
      • withAst

        public final ImmutableCacheEntry withAst​(DialobDocument value)
        Copy the current immutable object by setting a value for the ast attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for ast
        Returns:
        A modified copy of the this object
      • withProgram

        public final ImmutableCacheEntry withProgram​(DialobProgram value)
        Copy the current immutable object by setting a present value for the optional program attribute.
        Parameters:
        value - The value for program
        Returns:
        A modified copy of this object
      • withProgram

        public final ImmutableCacheEntry withProgram​(Optional<? extends DialobProgram> optional)
        Copy the current immutable object by setting an optional value for the program attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for program
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableCacheEntry that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: id, rev, source, ast, program.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value CacheEntry with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableCacheEntry copyOf​(DialobCache.CacheEntry instance)
        Creates an immutable copy of a DialobCache.CacheEntry value. 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 for ImmutableCacheEntry.
         ImmutableCacheEntry.builder()
            .id(String) // required id
            .rev(String) // required rev
            .source(io.dialob.client.api.DialobStore.StoreEntity) // required source
            .ast(io.dialob.client.api.DialobDocument) // required ast
            .program(io.dialob.program.DialobProgram) // optional program
            .build();
         
        Returns:
        A new ImmutableCacheEntry builder