How to use stringBuilder method in fast-check-monorepo

Best JavaScript code snippet using fast-check-monorepo

java.lang.StringBuilder.js

Source:java.lang.StringBuilder.js Github

copy

Full Screen

1/**2 * Hyperloop3 * Generated code is Copyright (c) 2017 Appcelerator, Inc. and subject to the4 * Appcelerator Platform Subscription agreement.5 *6 * WARNING: This is generated code. Modify at your own risk and without support7 *8 * @module java.lang.StringBuilder9 */10var Hyperloop = require('hyperloop');11var parentPackage = require('java.lang');12/**13 * @class java.lang.StringBuilder14 * @extends java.lang.AbstractStringBuilder 15 * @constructor16 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html}17 **/18var StringBuilder = function() {19 var result;20 // Allow the constructor to either invoke the real java constructor, or function as a "wrapping" method that will take21 // a single argument that is a native hyperloop proxy for this class type and just wraps it in our JS type.22 if (arguments.length == 1 && arguments[0].isNativeProxy && arguments[0].isInstanceProxy && arguments[0].isInstanceOf('java.lang.StringBuilder')) {23 result = arguments[0];24 }25 else {26 result = StringBuilder.class.newInstance(arguments);27 }28 this.$native = result;29 this._hasPointer = result != null;30 this._private = {};31};32var SuperClass = require('java.lang.AbstractStringBuilder');33StringBuilder.prototype = Object.create(SuperClass.prototype);34StringBuilder.prototype.constructor = StringBuilder;35Object.defineProperty(StringBuilder.prototype, 'super', {36 get: function() {37 if (!this._hasPointer) return null;38 return new StringBuilder(this.$native.super);39 },40 enumerable: true41});42StringBuilder.className = 'java.lang.StringBuilder';43StringBuilder.prototype.className = 'java.lang.StringBuilder';44// class property45Object.defineProperty(StringBuilder, 'class', {46 get: function() {47 return Hyperloop.getClass('java.lang.StringBuilder');48 },49 enumerable: true,50 configurable: false51});52// Cast53StringBuilder.cast = function(object) {54 if (!object.$native || !object.$native.isInstanceProxy) return object;55 return new StringBuilder(Hyperloop.cast('java.lang.StringBuilder', object.$native));56};57// Constants58// Inner classes59// Static fields60// Instance Fields61// Static methods62// Instance methods63/**64 * TODO Fill out docs more...65 * @function deleteCharAt66 * @memberof67 * @instance68 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#deleteCharAt(int)}69 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#deleteCharAt(int)}70 **/71StringBuilder.prototype.deleteCharAt = function() {72 if (!this._hasPointer) return null;73 var result = this.$native.callNativeFunction({74 func: 'deleteCharAt',75 instanceMethod: true,76 args: Array.prototype.slice.call(arguments)77 });78 if (result == null) {79 return null;80 }81 // Wrap result if it's not a primitive type?82 if (result.apiName) {83 if (result.apiName === 'java.lang.StringBuilder') {84 return new StringBuilder(result);85 } else {86 var ctor = require(result.apiName);87 return new ctor(result);88 }89 }90 return result;91};92/**93 * TODO Fill out docs more...94 * @function codePointAt95 * @memberof96 * @instance97 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#codePointAt(int)}98 **/99StringBuilder.prototype.codePointAt = function() {100 if (!this._hasPointer) return null;101 var result = this.$native.callNativeFunction({102 func: 'codePointAt',103 instanceMethod: true,104 args: Array.prototype.slice.call(arguments)105 });106 if (result == null) {107 return null;108 }109 // Wrap result if it's not a primitive type?110 if (result.apiName) {111 if (result.apiName === 'java.lang.StringBuilder') {112 return new StringBuilder(result);113 } else {114 var ctor = require(result.apiName);115 return new ctor(result);116 }117 }118 return result;119};120/**121 * TODO Fill out docs more...122 * @function replace123 * @memberof124 * @instance125 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#replace(int, int, java.lang.String)}126 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#replace(int, int, java.lang.String)}127 **/128StringBuilder.prototype.replace = function() {129 if (!this._hasPointer) return null;130 var result = this.$native.callNativeFunction({131 func: 'replace',132 instanceMethod: true,133 args: Array.prototype.slice.call(arguments)134 });135 if (result == null) {136 return null;137 }138 // Wrap result if it's not a primitive type?139 if (result.apiName) {140 if (result.apiName === 'java.lang.StringBuilder') {141 return new StringBuilder(result);142 } else {143 var ctor = require(result.apiName);144 return new ctor(result);145 }146 }147 return result;148};149/**150 * TODO Fill out docs more...151 * @function setCharAt152 * @memberof153 * @instance154 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#setCharAt(int, char)}155 **/156StringBuilder.prototype.setCharAt = function() {157 if (!this._hasPointer) return null;158 var result = this.$native.callNativeFunction({159 func: 'setCharAt',160 instanceMethod: true,161 args: Array.prototype.slice.call(arguments)162 });163 if (result == null) {164 return null;165 }166 // Wrap result if it's not a primitive type?167 if (result.apiName) {168 if (result.apiName === 'java.lang.StringBuilder') {169 return new StringBuilder(result);170 } else {171 var ctor = require(result.apiName);172 return new ctor(result);173 }174 }175 return result;176};177/**178 * TODO Fill out docs more...179 * @function insert180 * @memberof181 * @instance182 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, char[], int, int)}183 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, java.lang.Object)}184 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, java.lang.String)}185 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, char[])}186 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, java.lang.CharSequence)}187 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, java.lang.CharSequence, int, int)}188 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, boolean)}189 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, char)}190 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, int)}191 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, long)}192 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, float)}193 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, double)}194 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, double)}195 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, float)}196 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, long)}197 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, int)}198 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, char)}199 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, boolean)}200 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, java.lang.CharSequence, int, int)}201 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, java.lang.CharSequence)}202 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, char[])}203 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, java.lang.String)}204 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, java.lang.Object)}205 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#insert(int, char[], int, int)}206 **/207StringBuilder.prototype.insert = function() {208 if (!this._hasPointer) return null;209 var result = this.$native.callNativeFunction({210 func: 'insert',211 instanceMethod: true,212 args: Array.prototype.slice.call(arguments)213 });214 if (result == null) {215 return null;216 }217 // Wrap result if it's not a primitive type?218 if (result.apiName) {219 if (result.apiName === 'java.lang.StringBuilder') {220 return new StringBuilder(result);221 } else {222 var ctor = require(result.apiName);223 return new ctor(result);224 }225 }226 return result;227};228/**229 * TODO Fill out docs more...230 * @function delete231 * @memberof232 * @instance233 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#delete(int, int)}234 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#delete(int, int)}235 **/236StringBuilder.prototype.delete = function() {237 if (!this._hasPointer) return null;238 var result = this.$native.callNativeFunction({239 func: 'delete',240 instanceMethod: true,241 args: Array.prototype.slice.call(arguments)242 });243 if (result == null) {244 return null;245 }246 // Wrap result if it's not a primitive type?247 if (result.apiName) {248 if (result.apiName === 'java.lang.StringBuilder') {249 return new StringBuilder(result);250 } else {251 var ctor = require(result.apiName);252 return new ctor(result);253 }254 }255 return result;256};257/**258 * TODO Fill out docs more...259 * @function substring260 * @memberof261 * @instance262 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#substring(int, int)}263 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#substring(int)}264 **/265StringBuilder.prototype.substring = function() {266 if (!this._hasPointer) return null;267 var result = this.$native.callNativeFunction({268 func: 'substring',269 instanceMethod: true,270 args: Array.prototype.slice.call(arguments)271 });272 if (result == null) {273 return null;274 }275 // Wrap result if it's not a primitive type?276 if (result.apiName) {277 if (result.apiName === 'java.lang.StringBuilder') {278 return new StringBuilder(result);279 } else {280 var ctor = require(result.apiName);281 return new ctor(result);282 }283 }284 return result;285};286/**287 * TODO Fill out docs more...288 * @function capacity289 * @memberof290 * @instance291 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#capacity()}292 **/293StringBuilder.prototype.capacity = function() {294 if (!this._hasPointer) return null;295 var result = this.$native.callNativeFunction({296 func: 'capacity',297 instanceMethod: true,298 args: Array.prototype.slice.call(arguments)299 });300 if (result == null) {301 return null;302 }303 // Wrap result if it's not a primitive type?304 if (result.apiName) {305 if (result.apiName === 'java.lang.StringBuilder') {306 return new StringBuilder(result);307 } else {308 var ctor = require(result.apiName);309 return new ctor(result);310 }311 }312 return result;313};314/**315 * TODO Fill out docs more...316 * @function appendCodePoint317 * @memberof318 * @instance319 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#appendCodePoint(int)}320 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#appendCodePoint(int)}321 **/322StringBuilder.prototype.appendCodePoint = function() {323 if (!this._hasPointer) return null;324 var result = this.$native.callNativeFunction({325 func: 'appendCodePoint',326 instanceMethod: true,327 args: Array.prototype.slice.call(arguments)328 });329 if (result == null) {330 return null;331 }332 // Wrap result if it's not a primitive type?333 if (result.apiName) {334 if (result.apiName === 'java.lang.StringBuilder') {335 return new StringBuilder(result);336 } else {337 var ctor = require(result.apiName);338 return new ctor(result);339 }340 }341 return result;342};343/**344 * TODO Fill out docs more...345 * @function codePointBefore346 * @memberof347 * @instance348 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#codePointBefore(int)}349 **/350StringBuilder.prototype.codePointBefore = function() {351 if (!this._hasPointer) return null;352 var result = this.$native.callNativeFunction({353 func: 'codePointBefore',354 instanceMethod: true,355 args: Array.prototype.slice.call(arguments)356 });357 if (result == null) {358 return null;359 }360 // Wrap result if it's not a primitive type?361 if (result.apiName) {362 if (result.apiName === 'java.lang.StringBuilder') {363 return new StringBuilder(result);364 } else {365 var ctor = require(result.apiName);366 return new ctor(result);367 }368 }369 return result;370};371/**372 * TODO Fill out docs more...373 * @function indexOf374 * @memberof375 * @instance376 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#indexOf(java.lang.String)}377 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#indexOf(java.lang.String, int)}378 **/379StringBuilder.prototype.indexOf = function() {380 if (!this._hasPointer) return null;381 var result = this.$native.callNativeFunction({382 func: 'indexOf',383 instanceMethod: true,384 args: Array.prototype.slice.call(arguments)385 });386 if (result == null) {387 return null;388 }389 // Wrap result if it's not a primitive type?390 if (result.apiName) {391 if (result.apiName === 'java.lang.StringBuilder') {392 return new StringBuilder(result);393 } else {394 var ctor = require(result.apiName);395 return new ctor(result);396 }397 }398 return result;399};400/**401 * TODO Fill out docs more...402 * @function codePointCount403 * @memberof404 * @instance405 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#codePointCount(int, int)}406 **/407StringBuilder.prototype.codePointCount = function() {408 if (!this._hasPointer) return null;409 var result = this.$native.callNativeFunction({410 func: 'codePointCount',411 instanceMethod: true,412 args: Array.prototype.slice.call(arguments)413 });414 if (result == null) {415 return null;416 }417 // Wrap result if it's not a primitive type?418 if (result.apiName) {419 if (result.apiName === 'java.lang.StringBuilder') {420 return new StringBuilder(result);421 } else {422 var ctor = require(result.apiName);423 return new ctor(result);424 }425 }426 return result;427};428/**429 * TODO Fill out docs more...430 * @function trimToSize431 * @memberof432 * @instance433 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#trimToSize()}434 **/435StringBuilder.prototype.trimToSize = function() {436 if (!this._hasPointer) return null;437 var result = this.$native.callNativeFunction({438 func: 'trimToSize',439 instanceMethod: true,440 args: Array.prototype.slice.call(arguments)441 });442 if (result == null) {443 return null;444 }445 // Wrap result if it's not a primitive type?446 if (result.apiName) {447 if (result.apiName === 'java.lang.StringBuilder') {448 return new StringBuilder(result);449 } else {450 var ctor = require(result.apiName);451 return new ctor(result);452 }453 }454 return result;455};456/**457 * TODO Fill out docs more...458 * @function getChars459 * @memberof460 * @instance461 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#getChars(int, int, char[], int)}462 **/463StringBuilder.prototype.getChars = function() {464 if (!this._hasPointer) return null;465 var result = this.$native.callNativeFunction({466 func: 'getChars',467 instanceMethod: true,468 args: Array.prototype.slice.call(arguments)469 });470 if (result == null) {471 return null;472 }473 // Wrap result if it's not a primitive type?474 if (result.apiName) {475 if (result.apiName === 'java.lang.StringBuilder') {476 return new StringBuilder(result);477 } else {478 var ctor = require(result.apiName);479 return new ctor(result);480 }481 }482 return result;483};484/**485 * TODO Fill out docs more...486 * @function length487 * @memberof488 * @instance489 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#length()}490 **/491StringBuilder.prototype.length = function() {492 if (!this._hasPointer) return null;493 var result = this.$native.callNativeFunction({494 func: 'length',495 instanceMethod: true,496 args: Array.prototype.slice.call(arguments)497 });498 if (result == null) {499 return null;500 }501 // Wrap result if it's not a primitive type?502 if (result.apiName) {503 if (result.apiName === 'java.lang.StringBuilder') {504 return new StringBuilder(result);505 } else {506 var ctor = require(result.apiName);507 return new ctor(result);508 }509 }510 return result;511};512/**513 * TODO Fill out docs more...514 * @function subSequence515 * @memberof516 * @instance517 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#subSequence(int, int)}518 **/519StringBuilder.prototype.subSequence = function() {520 if (!this._hasPointer) return null;521 var result = this.$native.callNativeFunction({522 func: 'subSequence',523 instanceMethod: true,524 args: Array.prototype.slice.call(arguments)525 });526 if (result == null) {527 return null;528 }529 // Wrap result if it's not a primitive type?530 if (result.apiName) {531 if (result.apiName === 'java.lang.StringBuilder') {532 return new StringBuilder(result);533 } else {534 var ctor = require(result.apiName);535 return new ctor(result);536 }537 }538 return result;539};540/**541 * TODO Fill out docs more...542 * @function reverse543 * @memberof544 * @instance545 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#reverse()}546 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#reverse()}547 **/548StringBuilder.prototype.reverse = function() {549 if (!this._hasPointer) return null;550 var result = this.$native.callNativeFunction({551 func: 'reverse',552 instanceMethod: true,553 args: Array.prototype.slice.call(arguments)554 });555 if (result == null) {556 return null;557 }558 // Wrap result if it's not a primitive type?559 if (result.apiName) {560 if (result.apiName === 'java.lang.StringBuilder') {561 return new StringBuilder(result);562 } else {563 var ctor = require(result.apiName);564 return new ctor(result);565 }566 }567 return result;568};569/**570 * TODO Fill out docs more...571 * @function lastIndexOf572 * @memberof573 * @instance574 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#lastIndexOf(java.lang.String)}575 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#lastIndexOf(java.lang.String, int)}576 **/577StringBuilder.prototype.lastIndexOf = function() {578 if (!this._hasPointer) return null;579 var result = this.$native.callNativeFunction({580 func: 'lastIndexOf',581 instanceMethod: true,582 args: Array.prototype.slice.call(arguments)583 });584 if (result == null) {585 return null;586 }587 // Wrap result if it's not a primitive type?588 if (result.apiName) {589 if (result.apiName === 'java.lang.StringBuilder') {590 return new StringBuilder(result);591 } else {592 var ctor = require(result.apiName);593 return new ctor(result);594 }595 }596 return result;597};598/**599 * TODO Fill out docs more...600 * @function setLength601 * @memberof602 * @instance603 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#setLength(int)}604 **/605StringBuilder.prototype.setLength = function() {606 if (!this._hasPointer) return null;607 var result = this.$native.callNativeFunction({608 func: 'setLength',609 instanceMethod: true,610 args: Array.prototype.slice.call(arguments)611 });612 if (result == null) {613 return null;614 }615 // Wrap result if it's not a primitive type?616 if (result.apiName) {617 if (result.apiName === 'java.lang.StringBuilder') {618 return new StringBuilder(result);619 } else {620 var ctor = require(result.apiName);621 return new ctor(result);622 }623 }624 return result;625};626/**627 * TODO Fill out docs more...628 * @function toString629 * @memberof630 * @instance631 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#toString()}632 **/633StringBuilder.prototype.toString = function() {634 if (!this._hasPointer) return null;635 var result = this.$native.callNativeFunction({636 func: 'toString',637 instanceMethod: true,638 args: Array.prototype.slice.call(arguments)639 });640 if (result == null) {641 return null;642 }643 // Wrap result if it's not a primitive type?644 if (result.apiName) {645 if (result.apiName === 'java.lang.StringBuilder') {646 return new StringBuilder(result);647 } else {648 var ctor = require(result.apiName);649 return new ctor(result);650 }651 }652 return result;653};654/**655 * TODO Fill out docs more...656 * @function ensureCapacity657 * @memberof658 * @instance659 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#ensureCapacity(int)}660 **/661StringBuilder.prototype.ensureCapacity = function() {662 if (!this._hasPointer) return null;663 var result = this.$native.callNativeFunction({664 func: 'ensureCapacity',665 instanceMethod: true,666 args: Array.prototype.slice.call(arguments)667 });668 if (result == null) {669 return null;670 }671 // Wrap result if it's not a primitive type?672 if (result.apiName) {673 if (result.apiName === 'java.lang.StringBuilder') {674 return new StringBuilder(result);675 } else {676 var ctor = require(result.apiName);677 return new ctor(result);678 }679 }680 return result;681};682/**683 * TODO Fill out docs more...684 * @function append685 * @memberof686 * @instance687 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.Object)}688 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.String)}689 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.StringBuffer)}690 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.CharSequence)}691 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.CharSequence, int, int)}692 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(char[])}693 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(char[], int, int)}694 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(boolean)}695 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(char)}696 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(int)}697 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(long)}698 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(float)}699 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(double)}700 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(double)}701 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(float)}702 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(long)}703 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(int)}704 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(char)}705 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(boolean)}706 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(char[], int, int)}707 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(char[])}708 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.CharSequence, int, int)}709 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.CharSequence)}710 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.StringBuffer)}711 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.String)}712 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.Object)}713 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(char)}714 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.CharSequence, int, int)}715 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#append(java.lang.CharSequence)}716 **/717StringBuilder.prototype.append = function() {718 if (!this._hasPointer) return null;719 var result = this.$native.callNativeFunction({720 func: 'append',721 instanceMethod: true,722 args: Array.prototype.slice.call(arguments)723 });724 if (result == null) {725 return null;726 }727 // Wrap result if it's not a primitive type?728 if (result.apiName) {729 if (result.apiName === 'java.lang.StringBuilder') {730 return new StringBuilder(result);731 } else {732 var ctor = require(result.apiName);733 return new ctor(result);734 }735 }736 return result;737};738/**739 * TODO Fill out docs more...740 * @function offsetByCodePoints741 * @memberof742 * @instance743 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#offsetByCodePoints(int, int)}744 **/745StringBuilder.prototype.offsetByCodePoints = function() {746 if (!this._hasPointer) return null;747 var result = this.$native.callNativeFunction({748 func: 'offsetByCodePoints',749 instanceMethod: true,750 args: Array.prototype.slice.call(arguments)751 });752 if (result == null) {753 return null;754 }755 // Wrap result if it's not a primitive type?756 if (result.apiName) {757 if (result.apiName === 'java.lang.StringBuilder') {758 return new StringBuilder(result);759 } else {760 var ctor = require(result.apiName);761 return new ctor(result);762 }763 }764 return result;765};766/**767 * TODO Fill out docs more...768 * @function charAt769 * @memberof770 * @instance771 * @see {@link http://developer.android.com/reference/java/lang/StringBuilder.html#charAt(int)}772 **/773StringBuilder.prototype.charAt = function() {774 if (!this._hasPointer) return null;775 var result = this.$native.callNativeFunction({776 func: 'charAt',777 instanceMethod: true,778 args: Array.prototype.slice.call(arguments)779 });780 if (result == null) {781 return null;782 }783 // Wrap result if it's not a primitive type?784 if (result.apiName) {785 if (result.apiName === 'java.lang.StringBuilder') {786 return new StringBuilder(result);787 } else {788 var ctor = require(result.apiName);789 return new ctor(result);790 }791 }792 return result;793};794// export the class...

Full Screen

Full Screen

07_StringBuilderTest.js

Source:07_StringBuilderTest.js Github

copy

Full Screen

1class StringBuilder {2 constructor(string) {3 if (string !== undefined) {4 StringBuilder._vrfyParam(string);5 this._stringArray = Array.from(string);6 } else {7 this._stringArray = [];8 }9 }10 append(string) {11 StringBuilder._vrfyParam(string);12 for(let i = 0; i < string.length; i++) {13 this._stringArray.push(string[i]);14 }15 }16 prepend(string) {17 StringBuilder._vrfyParam(string);18 for(let i = string.length - 1; i >= 0; i--) {19 this._stringArray.unshift(string[i]);20 }21 }22 insertAt(string, startIndex) {23 StringBuilder._vrfyParam(string);24 this._stringArray.splice(startIndex, 0, ...string);25 }26 remove(startIndex, length) {27 this._stringArray.splice(startIndex, length);28 }29 static _vrfyParam(param) {30 if (typeof param !== 'string') throw new TypeError('Argument must be string');31 }32 toString() {33 return this._stringArray.join('');34 }35}36const assert = require("chai").assert;37describe('StringBuilder', function () {38 let stringBuilder;39 beforeEach(function () {40 stringBuilder = new StringBuilder();41 });42 it('should have the correct function properties', function () {43 assert.isFunction(StringBuilder.prototype.append);44 assert.isFunction(StringBuilder.prototype.prepend);45 assert.isFunction(StringBuilder.prototype.insertAt);46 assert.isFunction(StringBuilder.prototype.remove);47 assert.isFunction(StringBuilder.prototype.toString);48 });49 describe('constructor', function () {50 it('should work correctly without passed parameter', function () {51 const expected = '';52 const actual = stringBuilder.toString();53 assert.equal(actual, expected);54 });55 it('should work correctly with passed string parameter', function () {56 stringBuilder = new StringBuilder('abc');57 const expected = 'abc';58 const actual = stringBuilder._stringArray.join('');59 assert.equal(actual, expected);60 });61 it('should throw error when different type from string is passed', function () {62 assert.throw(() => {63 new StringBuilder([]);64 }, 'Argument must be string');65 });66 it('should work correctly with passed undefined parameter', function () {67 stringBuilder = new StringBuilder(undefined);68 const expected = 0;69 const actual = stringBuilder._stringArray.length;70 assert.equal(actual, expected);71 });72 });73 describe('append', function () {74 it('should throw error when different type from string is passed', function () {75 assert.throw(() => {76 stringBuilder.append({});77 }, 'Argument must be string');78 });79 it('should work correctly with passed string parameter', function () {80 stringBuilder.append('abc');81 const expected = 'abc';82 const actual = stringBuilder.toString();83 assert.equal(actual, expected);84 });85 it('should work correctly when the function is called multiple times', function () {86 stringBuilder.append('abc');87 stringBuilder.append('def');88 stringBuilder.append('ghi');89 const expected = 'abcdefghi';90 const actual = stringBuilder.toString();91 assert.equal(actual, expected);92 });93 });94 describe('prepend', function () {95 it('should throw error when different type from string is passed', function () {96 assert.throw(() => {97 stringBuilder.prepend(4);98 }99 , 'Argument must be string');100 });101 it('should work correctly with passed string parameter', function () {102 stringBuilder.prepend('abc');103 const expected = 'abc';104 const actual = stringBuilder.toString();105 assert.equal(actual, expected);106 });107 it('should work correctly when the function is called multiple times', function () {108 stringBuilder.prepend('abc');109 stringBuilder.prepend('def');110 stringBuilder.prepend('ghi');111 const expected = 'ghidefabc';112 const actual = stringBuilder.toString();113 assert.equal(actual, expected);114 });115 });116 describe('insertAt', function () {117 it('should throw error when different type from string is passed', function () {118 assert.throw(() => {119 stringBuilder.insertAt(true, 4);120 }121 , 'Argument must be string');122 });123 it('should work correctly with passed string parameter', function () {124 stringBuilder.append('abc');125 stringBuilder.insertAt(' appended text ', 1);126 const expected = 'a appended text bc';127 const actual = stringBuilder.toString();128 assert.equal(actual, expected);129 });130 it('should work correctly when the function is called multiple times', function () {131 stringBuilder.append('abc');132 stringBuilder.insertAt(' appended text ', 1);133 stringBuilder.insertAt(' appended text ', 1);134 stringBuilder.insertAt(' appended text ', 1);135 const expected = 'a appended text appended text appended text bc';136 const actual = stringBuilder.toString();137 assert.equal(actual, expected);138 });139 it('should work correctly with negative index', function () {140 stringBuilder.append('abcd');141 stringBuilder.insertAt(' appended text ', -1);142 const expected = 'abc appended text d';143 const actual = stringBuilder.toString();144 assert.equal(actual, expected);145 });146 });147 describe('remove', function () {148 it('should work correctly with valid indexes', function () {149 stringBuilder.append('abc');150 stringBuilder.remove(1, 2);151 const expected = 'a';152 const actual = stringBuilder.toString();153 assert.equal(actual, expected);154 });155 it('should work correctly when the function is called multiple times', function () {156 stringBuilder.append('abcdefghi');157 stringBuilder.remove(5, 2);158 stringBuilder.remove(3, 1);159 stringBuilder.remove(1, 2);160 const expected = 'aehi';161 const actual = stringBuilder.toString();162 assert.equal(actual, expected);163 });164 });165 it('should work correctly when multiple functions are called', function () {166 stringBuilder.append('ghi');167 stringBuilder.prepend('abc');168 stringBuilder.insertAt('def', 3);169 stringBuilder.remove(3, 3);170 const expected = 'abcghi';171 const actual = stringBuilder.toString();172 assert.equal(actual, expected);173 });...

Full Screen

Full Screen

json.js

Source:json.js Github

copy

Full Screen

1new function () {2 var _serverTypeFieldName = '__type';3 var _stringRegEx = new RegExp('[\"\\\\b\\\\f\\\\n\\\\r\\\\t\\\\\\\\\\\\x00-\\\\x1F]', 'i');4 var _dateRegEx = new RegExp('(^|[^\\\\\\\\])\\\\\"\\\\\\\\/Date\\\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\\\+|-)[0-9]{4})?\\\\)\\\\\\\\/\\\\\"', 'g');5 var _jsonRegEx = new RegExp('[^,:{}\\\\[\\\\]0-9.\\\\-+Eaeflnr-u \\\\n\\\\r\\\\t]', 'g');6 var _jsonStringRegEx = new RegExp('\"(\\\\\\\\.|[^\"\\\\\\\\])*\"', 'g');7 this.serialize = function (object) {8 var stringBuilder = [];9 this._serialize (object, stringBuilder);10 return stringBuilder.join ('');11 }12 this.deserialize = function (data) {13 if (data.length === 0) throw 'cannotDeserializeEmptyString';14 var exp = data.replace (_dateRegEx, "$1new Date($2)");15 return eval ('(' + exp + ')');16 }17 this._serializeBoolean = function (object, stringBuilder) {18 stringBuilder.push (object.toString ());19 }20 this._serializeNumber = function (object, stringBuilder) {21 if (isFinite (object))22 stringBuilder.push (String (object));23 else24 throw 'cannotSerializeNonFiniteNumbers';25 }26 this._serializeString = function (object, stringBuilder) {27 stringBuilder.push ('\"');28 if (_stringRegEx.test (object)) {29 var length = object.length;30 for (i = 0; i < length; i++) {31 var curChar = object.charAt (i);32 if (curChar >= ' ') {33 if (curChar === '\\\\' || curChar === '\"')34 stringBuilder.push ('\\\\');35 stringBuilder.push (curChar);36 } else {37 switch (curChar) {38 case '\\b':39 stringBuilder.push ('\\\\b');40 break;41 case '\\f':42 stringBuilder.push ('\\\\f');43 break;44 case '\\n':45 stringBuilder.push ('\\\\n');46 break;47 case '\\r':48 stringBuilder.push ('\\\\r');49 break;50 case '\\t':51 stringBuilder.push ('\\\\t');52 break;53 default:54 stringBuilder.push ('\\\\u00');55 if (curChar.charCodeAt () < 16)56 stringBuilder.push ('0');57 stringBuilder.push (curChar.charCodeAt ().toString (16));58 }59 }60 }61 } else {62 stringBuilder.push (object);63 }64 stringBuilder.push ('\"');65 }66 this._serialize = function (object, stringBuilder) {67 var i;68 switch (typeof object) {69 case 'object':70 if (object) {71 if (object instanceof Number)72 this._serializeNumber (object, stringBuilder);73 else if (object instanceof Boolean)74 this._serializeBoolean (object, stringBuilder);75 else if (object instanceof String)76 this._serializeString (object, stringBuilder);77 else if (object instanceof Array) {78 stringBuilder.push ('[');79 for (i = 0; i < object.length; i++) {80 if (i > 0)81 stringBuilder.push (',');82 this._serialize (object[i], stringBuilder);83 }84 stringBuilder.push (']');85 } else if (object instanceof Date) {86 stringBuilder.push ('\"\\/Date(');87 stringBuilder.push (object.getTime ());88 stringBuilder.push (')\\/\"');89 } else if (this._managedServices.requiresManagedSerializer (object))90 stringBuilder.push (this._managedServices.jsonSerialize (object));91 else {92 var properties = [];93 var propertyCount = 0;94 for (var name in object) {95 if (name.length > 0 && name[0] == '$')96 continue;97 if (name === _serverTypeFieldName && propertyCount !== 0) {98 properties[propertyCount++] = properties[0];99 properties[0] = name;100 } else101 properties[propertyCount++] = name;102 }103 stringBuilder.push ('{');104 var needComma = false;105 for (i = 0; i < propertyCount; i++) {106 var value = object[properties[i]];107 if (typeof value !== 'undefined' && typeof value !== 'function') {108 if (needComma)109 stringBuilder.push (',');110 else111 needComma = true;112 this._serialize (properties[i], stringBuilder);113 stringBuilder.push (':');114 this._serialize (value, stringBuilder);115 }116 }117 stringBuilder.push ('}');118 }119 } else120 stringBuilder.push('null');121 break;122 case 'number':123 this._serializeNumber (object, stringBuilder);124 break;125 case 'string':126 this._serializeString (object, stringBuilder);127 break;128 case 'boolean':129 this._serializeBoolean (object, stringBuilder);130 break;131 case 'function':132 if (this._managedServices.requiresManagedSerializer (object))133 stringBuilder.push (this._managedServices.jsonSerialize (object));134 else135 stringBuilder.push ('null');136 break;137 default:138 stringBuilder.push ('null');139 break;140 }141 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { stringBuilder } = require('fast-check-monorepo');2const { stringBuilder } = require('fast-check');3const { stringBuilder } = require('fast-check-monorepo');4const { stringBuilder } = require('fast-check');5const { stringBuilder } = require('fast-check-monorepo');6const { stringBuilder } = require('fast-check');7const { stringBuilder } = require('fast-check-monorepo');8const { stringBuilder } = require('fast-check');9const { stringBuilder } = require('fast-check-monorepo');10const { stringBuilder } = require('fast-check');11const { stringBuilder } = require('fast-check-monorepo');12const { stringBuilder } = require('fast-check');13const { stringBuilder } = require('fast-check-monorepo');14const { stringBuilder } = require('fast-check');15const { stringBuilder } = require('fast-check-monorepo');16const { stringBuilder } = require('fast-check');17const { stringBuilder } = require('fast-check-monorepo');18const { stringBuilder } = require('fast-check');19const { stringBuilder } = require('fast-check-monorepo');20const { stringBuilder } = require('fast-check');21const { stringBuilder } = require('fast-check-monorepo');22const { stringBuilder } = require('fast-check');

Full Screen

Using AI Code Generation

copy

Full Screen

1const { stringBuilder } = require('fast-check-monorepo');2const str = stringBuilder(100);3console.log(str);4{5 "scripts": {6 },7 "dependencies": {8 }9}

Full Screen

Using AI Code Generation

copy

Full Screen

1const { stringBuilder } = require('fast-check-monorepo');2console.log(stringBuilder('a', 'b'));3const { stringBuilder } = require('fast-check-monorepo');4console.log(stringBuilder('a', 'b'));5const { stringBuilder } = require('fast-check-monorepo');6console.log(stringBuilder('a', 'b'));7const { stringBuilder } = require('fast-check-monorepo');8console.log(stringBuilder('a', 'b'));9const { stringBuilder } = require('fast-check-monorepo');10console.log(stringBuilder('a', 'b'));11const { stringBuilder } = require('fast-check-monorepo');12console.log(stringBuilder('a', 'b'));13const { stringBuilder } = require('fast-check-monorepo');14console.log(stringBuilder('a', 'b'));15const { stringBuilder } = require('fast-check-monorepo');16console.log(stringBuilder('a', 'b'));17const { stringBuilder } = require('fast-check-monorepo');18console.log(stringBuilder('a', 'b'));19const { stringBuilder } = require('fast-check-monorepo');20console.log(stringBuilder('a', 'b'));21const { stringBuilder } = require('fast-check-monorepo');22console.log(stringBuilder('a', 'b'));23const { stringBuilder } = require('fast-check-monorepo');24console.log(stringBuilder('a', 'b'));

Full Screen

Using AI Code Generation

copy

Full Screen

1const {stringBuilder} = require('fast-check');2const {property} = require('fast-check');3property(stringBuilder(), s => {4 console.log(s);5 return true;6}).then(() => console.log('done'));

Full Screen

Using AI Code Generation

copy

Full Screen

1const { stringBuilder } = require('fast-check-monorepo');2console.log(stringBuilder(5));3const { stringBuilder } = require('fast-check-monorepo');4console.log(stringBuilder(5));5const { stringBuilder } = require('fast-check-monorepo');6console.log(stringBuilder(5));7const { stringBuilder } = require('fast-check-monorepo');8console.log(stringBuilder(5));9const { stringBuilder } = require('fast-check-monorepo');10console.log(stringBuilder(5));11const { stringBuilder } = require('fast-check-monorepo');12console.log(stringBuilder(5));13const { stringBuilder } = require('fast-check-monorepo');14console.log(stringBuilder(5));15const { stringBuilder } = require('fast-check-monorepo');16console.log(stringBuilder(5));17const { stringBuilder } = require('fast-check-monorepo');18console.log(stringBuilder(5));19const { stringBuilder } = require('fast-check-monorepo');20console.log(stringBuilder(5));21const { stringBuilder } = require('fast-check-monorepo');22console.log(stringBuilder(5));23const { stringBuilder

Full Screen

Using AI Code Generation

copy

Full Screen

1const { stringBuilder } = require('fast-check-monorepo');2console.log(stringBuilder('hello'));3const { stringBuilder } = require('fast-check-monorepo');4console.log(stringBuilder('hello'));5const { stringBuilder } = require('fast-check-monorepo');6console.log(stringBuilder('hello'));7const { stringBuilder } = require('fast-check-monorepo');8console.log(stringBuilder('hello'));9const { stringBuilder } = require('fast-check-monorepo');10console.log(stringBuilder('hello'));11const { stringBuilder } = require('fast-check-monorepo');12console.log(stringBuilder('hello'));13const { stringBuilder } = require('fast-check-monorepo');14console.log(stringBuilder('hello'));15const { stringBuilder } = require('fast-check-monorepo');16console.log(stringBuilder('hello'));17const { stringBuilder } = require('fast-check-monorepo');18console.log(stringBuilder('hello'));19const { stringBuilder } = require('fast-check-monorepo');20console.log(stringBuilder('hello'));21const { stringBuilder } = require('fast-check-monorepo');22console.log(stringBuilder('hello'));23const { stringBuilder

Full Screen

Using AI Code Generation

copy

Full Screen

1import { StringBuilder } from 'fast-check-monorepo'2const sb = new StringBuilder()3sb.append('Hello')4sb.append('World')5sb.append('!')6import { StringBuilder } from 'fast-check-monorepo'7const sb = new StringBuilder()8sb.append('Hello')9sb.append('World')10sb.append('!')11import { StringBuilder } from 'fast-check-monorepo'12const sb = new StringBuilder()13sb.append('Hello')14sb.append('World')15sb.append('!')16import { StringBuilder } from 'fast-check-monorepo'17const sb = new StringBuilder()18sb.append('Hello')19sb.append('World')20sb.append('!')21import { StringBuilder } from 'fast-check-monorepo'22const sb = new StringBuilder()23sb.append('Hello')24sb.append('World')25sb.append('!')26import { StringBuilder } from 'fast-check-monorepo'27const sb = new StringBuilder()28sb.append('Hello')29sb.append('World')30sb.append('!')31import { StringBuilder } from 'fast-check-monorepo'32const sb = new StringBuilder()33sb.append('Hello')34sb.append('World')35sb.append('!')36import { StringBuilder } from 'fast-check-monorepo'37const sb = new StringBuilder()38sb.append('Hello')39sb.append('World')40sb.append('!')41import { StringBuilder } from 'fast-check-monorepo'42const sb = new StringBuilder()43sb.append('Hello')44sb.append('

Full Screen

Using AI Code Generation

copy

Full Screen

1const { stringBuilder } = require('fast-check-monorepo');2const { string } = require('fast-check');3const sb = stringBuilder();4sb.add(string());5sb.add(string());6const result = sb.build();7console.log(result);

Full Screen

Using AI Code Generation

copy

Full Screen

1const {stringBuilder} = require('fast-check-monorepo');2const {numberBuilder} = require('fast-check-monorepo');3const {booleanBuilder} = require('fast-check-monorepo');4const string = stringBuilder();5const number = numberBuilder(string);6const boolean = booleanBuilder(number);7console.log(string, number, boolean);8{9 "scripts": {10 },11 "dependencies": {12 }13}

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fast-check-monorepo automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful