/** * @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(mode = JsonCreator.Mode.DELEGATING) static ImmutableStop fromJson(Json json) { ImmutableStop.Builder builder = ImmutableStop.builder(); if (json.startNewVirtualUserIsSet) { builder.startNewVirtualUser(json.startNewVirtualUser); } if (json.name != null) { builder.name(json.name); } if (json.description != null) { builder.description(json.description); } return builder.build(); }
/** * Builds a new {@link ImmutableStop ImmutableStop}. * @return An immutable instance of Stop * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableStop build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableStop(startNewVirtualUser, name, description); }
/** * Fill a builder with attribute values from the provided {@code com.neotys.neoload.model.repository.Stop} instance. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder from(Stop instance) { Objects.requireNonNull(instance, "instance"); from((Object) instance); return this; }
private void from(Object object) { if (object instanceof Stop) { Stop instance = (Stop) object; startNewVirtualUser(instance.startNewVirtualUser()); } if (object instanceof Element) { Element instance = (Element) object; name(instance.getName()); Optional<String> descriptionOptional = instance.getDescription(); if (descriptionOptional.isPresent()) { description(descriptionOptional); } } }
/** * Creates an immutable copy of a {@link Stop} 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 Stop instance */ public static ImmutableStop copyOf(Stop instance) { if (instance instanceof ImmutableStop) { return (ImmutableStop) instance; } return ImmutableStop.builder() .from(instance) .build(); }
private ImmutableList<Element> buildStopElements(final MethodCall method, final ExitStatus exitStatus) { ImmutableList.Builder<Element> builder = ImmutableList.builder(); buildJavaScriptIfNeeded(exitStatus).ifPresent(builder::add); builder.add(ImmutableStop.builder() .name(MethodUtils.unquote(method.getName())) .startNewVirtualUser(true) .build()); return builder.build(); }
/** * Fill a builder with attribute values from the provided {@code com.neotys.neoload.model.core.Element} instance. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder from(Element instance) { Objects.requireNonNull(instance, "instance"); from((Object) instance); return this; }
/** * Creates a builder for {@link ImmutableStop ImmutableStop}. * @return A new ImmutableStop builder */ public static ImmutableStop.Builder builder() { return new ImmutableStop.Builder(); }