/** * Creates an immutable copy of a {@link SessionInfo} 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 SessionInfo instance */ public static ImmutableSessionInfo copyOf(SessionInfo instance) { if (instance instanceof ImmutableSessionInfo) { return (ImmutableSessionInfo) instance; } return ImmutableSessionInfo.builder() .from(instance) .build(); }
@JsonCreator static ImmutableSessionInfo fromJson(Json json) { ImmutableSessionInfo.Builder builder = ImmutableSessionInfo.builder(); if (json.createIndex != null) { builder.createIndex(json.createIndex);