builder.name("Set cookie " + cookieName + " for server " + server.getName()) .cookieName(cookieName) .cookieValue(cookieValue) .server(server); builder.expires(Long.toString(maxAge)); return ImmutableList.of(builder.build());
/** * Builds a new {@link ImmutableAddCookie ImmutableAddCookie}. * @return An immutable instance of AddCookie * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableAddCookie build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableAddCookie(cookieName, cookieValue, server, expires, path, name, description); }
/** * Fill a builder with attribute values from the provided {@code com.neotys.neoload.model.repository.AddCookie} 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(AddCookie instance) { Objects.requireNonNull(instance, "instance"); from((Object) instance); return this; }
ImmutableAddCookie.Builder builder = ImmutableAddCookie.builder(); if (json.cookieName != null) { builder.cookieName(json.cookieName); builder.cookieValue(json.cookieValue); builder.server(json.server); builder.expires(json.expires); builder.path(json.path); builder.name(json.name); builder.description(json.description); return builder.build();
private void from(Object object) { if (object instanceof AddCookie) { AddCookie instance = (AddCookie) object; server(instance.getServer()); Optional<String> pathOptional = instance.getPath(); if (pathOptional.isPresent()) { path(pathOptional); } cookieValue(instance.getCookieValue()); Optional<String> expiresOptional = instance.getExpires(); if (expiresOptional.isPresent()) { expires(expiresOptional); } cookieName(instance.getCookieName()); } 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 AddCookie} 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 AddCookie instance */ public static ImmutableAddCookie copyOf(AddCookie instance) { if (instance instanceof ImmutableAddCookie) { return (ImmutableAddCookie) instance; } return ImmutableAddCookie.builder() .from(instance) .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 ImmutableAddCookie ImmutableAddCookie}. * @return A new ImmutableAddCookie builder */ public static ImmutableAddCookie.Builder builder() { return new ImmutableAddCookie.Builder(); }