/** * @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(); }
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); } } }
private Element buildJavaScript(final String javaScriptContent) { return ImmutableJavascript.builder() .name("failure-log") .content(javaScriptContent) .build(); }