Class FileEntity.Unmodifiable

All Implemented Interfaces:
HttpEntity, UnmodifiableBean
Enclosing class:
FileEntity

public static class FileEntity.Unmodifiable extends FileEntity implements UnmodifiableBean
Unmodifiable point-in-time snapshot of the enclosing FileEntity.

Its only behavioral override is modify(Runnable), which throws — because all mutation is funneled through modify(...), this single override freezes the entire mutation surface.

  • Constructor Details

    • Unmodifiable

      protected Unmodifiable(FileEntity copyFrom)
      Constructor.
      Parameters:
      copyFrom - The entity to snapshot. Must not be null.
  • Method Details

    • modify

      protected FileEntity modify(Runnable mutation)
      Description copied from class: BasicHttpEntity
      Single mutation funnel — the only choke-point through which all state changes on this bean flow.

      Every fluent setter routes through this method. The nested Unmodifiable snapshot overrides only this method to throw, which freezes the entire mutation surface with a single override.

      Overrides:
      modify in class BasicHttpEntity<FileEntity>
      Parameters:
      mutation - The state change to apply.
      Returns:
      This object.