/** * @param json A JSON-bindable data structure * @return An immutable value type * @deprecated Do not use this method directly, it exists only for the <em>Jackson</em>-binding infrastructure */ @Deprecated @JsonCreator static ImmutableEventResponse fromJson(Json json) { ImmutableEventResponse.Builder builder = ImmutableEventResponse.builder(); if (json.events != null) { builder.addAllEvents(json.events); } if (json.index != null) { builder.index(json.index); } return builder.build(); }
/** * Creates an immutable copy of a {@link EventResponse} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable EventResponse instance */ public static ImmutableEventResponse copyOf(EventResponse instance) { if (instance instanceof ImmutableEventResponse) { return (ImmutableEventResponse) instance; } return ImmutableEventResponse.builder() .from(instance) .build(); }