/** * @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 ImmutableJavascript fromJson(Json json) { ImmutableJavascript.Builder builder = ImmutableJavascript.builder(); if (json.content != null) { builder.content(json.content); } if (json.name != null) { builder.name(json.name); } if (json.description != null) { builder.description(json.description); } return builder.build(); }
/** * Builds a new {@link ImmutableJavascript ImmutableJavascript}. * @return An immutable instance of Javascript * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableJavascript build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableJavascript(content, name, description); }
/** * Fill a builder with attribute values from the provided {@code com.neotys.neoload.model.repository.Javascript} 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(Javascript instance) { Objects.requireNonNull(instance, "instance"); from((Object) instance); return this; }
/** * Creates an immutable copy of a {@link Javascript} 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 Javascript instance */ public static ImmutableJavascript copyOf(Javascript instance) { if (instance instanceof ImmutableJavascript) { return (ImmutableJavascript) instance; } return ImmutableJavascript.builder() .from(instance) .build(); }
private void from(Object object) { if (object instanceof Javascript) { Javascript instance = (Javascript) object; content(instance.getContent()); } if (object instanceof Element) { Element instance = (Element) object; name(instance.getName()); Optional<String> descriptionOptional = instance.getDescription(); if (descriptionOptional.isPresent()) { description(descriptionOptional); } } }
/** * Creates a builder for {@link ImmutableJavascript ImmutableJavascript}. * @return A new ImmutableJavascript builder */ public static ImmutableJavascript.Builder builder() { return new ImmutableJavascript.Builder(); }
/** * 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; }