@Override public List<Element> getElement(final LoadRunnerVUVisitor visitor, final MethodCall method, final MethodcallContext ctx) { Preconditions.checkNotNull(method); if(method.getParameters() == null || method.getParameters().size()!=2){ visitor.readSupportedFunctionWithWarn(method.getName(), ctx, method.getName() + " method must have 2 parameters"); return Collections.emptyList(); } visitor.readSupportedFunction(method.getName(), ctx); final String s0 = method.getParameters().get(0); final String s1 = method.getParameters().get(1); final List<String> args = ImmutableList.of(s0, s1); final String name = "strcmp_" + counter.incrementAndGet(); return ImmutableList.of(ImmutableStrcmp.builder() .name(name) .args(args) .returnValue(MethodUtils.getVariableSyntax(name)) .build()); } }
/** * Sets or replaces all elements for {@link Strcmp#getArgs() args} list. * @param elements An iterable of args elements * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("args") public final Builder args(Iterable<String> elements) { this.args = ImmutableList.builder(); return addAllArgs(elements); }
/** * Builds a new {@link ImmutableStrcmp ImmutableStrcmp}. * @return An immutable instance of Strcmp * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableStrcmp build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableStrcmp(args.build(), returnValue, name, description); }
/** * @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 ImmutableStrcmp fromJson(Json json) { ImmutableStrcmp.Builder builder = ImmutableStrcmp.builder(); if (json.args != null) { builder.addAllArgs(json.args); } if (json.returnValue != null) { builder.returnValue(json.returnValue); } if (json.name != null) { builder.name(json.name); } if (json.description != null) { builder.description(json.description); } return builder.build(); }
/** * Creates an immutable copy of a {@link Strcmp} 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 Strcmp instance */ public static ImmutableStrcmp copyOf(Strcmp instance) { if (instance instanceof ImmutableStrcmp) { return (ImmutableStrcmp) instance; } return ImmutableStrcmp.builder() .from(instance) .build(); }
private void from(Object object) { if (object instanceof Function) { Function instance = (Function) object; addAllArgs(instance.getArgs()); returnValue(instance.getReturnValue()); } if (object instanceof Element) { Element instance = (Element) object; name(instance.getName()); Optional<String> descriptionOptional = instance.getDescription(); if (descriptionOptional.isPresent()) { description(descriptionOptional); } } }
/** * Fill a builder with attribute values from the provided {@code com.neotys.neoload.model.function.Function} 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(Function instance) { Objects.requireNonNull(instance, "instance"); from((Object) instance); return this; }
/** * Creates a builder for {@link ImmutableStrcmp ImmutableStrcmp}. * @return A new ImmutableStrcmp builder */ public static ImmutableStrcmp.Builder builder() { return new ImmutableStrcmp.Builder(); }
/** * Fill a builder with attribute values from the provided {@code com.neotys.neoload.model.function.Strcmp} 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(Strcmp instance) { Objects.requireNonNull(instance, "instance"); from((Object) instance); return this; }
/** * 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; }