Class Created.Unmodifiable

All Implemented Interfaces:
HttpMessage, HttpResponse, UnmodifiableBean
Enclosing class:
Created

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

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(Created copyFrom)
      Constructor.
      Parameters:
      copyFrom - The response to snapshot. Must not be null.
  • Method Details

    • modify

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

      Every mutator (fluent setter and void interface mutator) 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 BasicHttpResponse<Created>
      Parameters:
      mutation - The state change to apply.
      Returns:
      This object.