Search in sources :

Example 31 with StringBuilder

use of java.lang.StringBuilder in project selenium_java by sergueik.

the class App method inject.

public static void inject() throws InterruptedException, java.io.IOException {
    /*
		 		WebElement loginLink = driver.findElement(By.id("_ctl0__ctl0_LoginLink"));
				loginLink.click();
				WebElement userId = driver.findElement(By.id("uid"));
				userId.clear();
				userId.sendKeys("nobody");
				WebElement passwId = driver.findElement(By.id("passw"));
				passwId.clear();
				passwId.sendKeys("nobody");
		*/
    String needJqueryInjectionScript = "return this.$ === undefined;";
    boolean needJqueryInjection = (Boolean) (executeScript(needJqueryInjectionScript));
    System.err.println("needJqueryInjection : " + needJqueryInjection);
    if (needJqueryInjection) {
        if (inject_local_script) {
            // TODO: resource loading not tested
            try {
                URI resourceURL = App.class.getClassLoader().getResource("inject_jquery.js").toURI();
                String jqueryScript = resourceURL.toString();
                executeScript(jqueryScript);
            } catch (URISyntaxException e) {
                throw new RuntimeException(e);
            }
        } else {
            // inline
            String jqueryLoaderScript = "var jqueryScriptElement  = document.createElement('script');" + "  jqueryScriptElement.type = 'text/javascript';" + "  jqueryScriptElement.src  = unescape('http%3a%2f%2fcode.jquery.com%2fjquery-latest.min.js');" + "  var target = document.getElementsByTagName('head')[0];" + "  target.appendChild(jqueryScriptElement);";
            executeScript(jqueryLoaderScript);
            Thread.sleep(1000);
        }
    }
    // TODO: disable the page animations : $('body').append('<style> *
    // {transition: none!important;}</style>')
    String jqueryEnabledScript = "if (window.jQuery) {  return true } else { return false  } ";
    boolean jqueryEnabled = (Boolean) (executeScript(jqueryEnabledScript));
    System.err.println("Jquery enabled : " + jqueryEnabled);
    assertTrue(jqueryEnabled);
    String buttonElementLocator = "input[value='Search']";
    StringBuilder sb = new StringBuilder();
    // Send all output to the Appendable object sb
    Formatter formatter = new Formatter(sb, Locale.US);
    String jQueryElementLocatorScript = formatter.format("return jQuery(\"%s\")", buttonElementLocator).toString();
    System.err.println("Running : " + jQueryElementLocatorScript);
    @SuppressWarnings("unchecked") List<Object> searchButtonObjects = (List<Object>) (executeScript(jQueryElementLocatorScript));
    assertThat(searchButtonObjects, notNullValue());
    assertTrue(searchButtonObjects.size() > 0);
    Iterator<Object> searchButtonObjectIterator = searchButtonObjects.iterator();
    int cnt = 0;
    WebElement searchButtonElement = null;
    while (searchButtonObjectIterator.hasNext()) {
        Object searchButtonObject = searchButtonObjectIterator.next();
        // [type="submit", value="Login", name="btnSubmit"]
        // [org.openqa.selenium.remote.RemoteWebElement@30 -> unknown locator]
        System.err.println("Returned (raw): " + searchButtonObject.toString());
        searchButtonElement = (WebElement) searchButtonObject;
        System.err.format("%s %s %s\n", searchButtonElement.getTagName(), searchButtonElement.getAttribute("value"), searchButtonElement.getAttribute("type"));
        if (searchButtonElement.getAttribute("value").equalsIgnoreCase("search")) {
            cnt = cnt + 1;
        // highlight(searchButtonElement);
        }
    }
    System.err.println("Search Button found " + cnt + " times");
    assertThat(searchButtonElement, notNullValue());
    searchButtonElement.click();
    try {
        // http://obscuredclarity.blogspot.com/2012/10/unit-testing-runtime-exceptions-with.html
        WebElement accountButtonElement = driver.findElement(By.id("btnGetAccount"));
        // does one need to be a JUnit method
        fail("Expected exception");
    } catch (NoSuchElementException e) {
        // pass - not being caught by this block
        // {"method":"id","selector":"btnGetAccount"}
        assertTrue(e.getMessage().contains("Unable to locate element: "));
    } catch (Exception e) {
        assertThat(e, instanceOf(org.openqa.selenium.NoSuchElementException.class));
        // cannot find symbol
        // assertThat(e.getMessage(), containsString("Unable to locate element:
        // "));
        // {"method":"id","selector":"btnGetAccount"}
        assertTrue(e.getMessage().contains("Unable to locate element: "));
    // System.err.println("Cause: " + e.getCause()); // Cause:
    // org.openqa.selenium.remote.ScreenshotException
    // System.err.println("Full stack trace:\n" +
    // org.apache.commons.lang.exception.ExceptionUtils.getFullStackTrace(e));
    }
}
Also used : StringBuilder(java.lang.StringBuilder) Formatter(java.util.Formatter) URISyntaxException(java.net.URISyntaxException) WebElement(org.openqa.selenium.WebElement) URI(java.net.URI) ServletException(javax.servlet.ServletException) URISyntaxException(java.net.URISyntaxException) JSONException(org.json.JSONException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) BindException(java.net.BindException) NoSuchElementException(java.util.NoSuchElementException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) JSONObject(org.json.JSONObject) List(java.util.List) ArrayList(java.util.ArrayList) NoSuchElementException(java.util.NoSuchElementException)

Example 32 with StringBuilder

use of java.lang.StringBuilder in project clochure by videlalvaro.

the class LispReader method readNumber.

private static Object readNumber(PushbackReader r, char initch) {
    StringBuilder sb = new StringBuilder();
    sb.append(initch);
    for (; ; ) {
        int ch = read1(r);
        if (ch == -1 || isWhitespace(ch) || isMacro(ch)) {
            unread(r, ch);
            break;
        }
        sb.append((char) ch);
    }
    String s = sb.toString();
    Object n = matchNumber(s);
    if (n == null)
        throw new NumberFormatException("Invalid number: " + s);
    return n;
}
Also used : StringBuilder(java.lang.StringBuilder) NumberFormatException(java.lang.NumberFormatException) Object(java.lang.Object) String(java.lang.String)

Example 33 with StringBuilder

use of java.lang.StringBuilder in project aerosolve by airbnb.

the class DecisionTreeModel method toHumanReadableTransform.

// Returns the transform config in human readable form.
public String toHumanReadableTransform() {
    StringBuilder sb = new StringBuilder();
    sb.append("  nodes: [\n");
    for (int i = 0; i < stumps.size(); i++) {
        ModelRecord stump = stumps.get(i);
        sb.append("    \"");
        if (stump.isSetLeftChild()) {
            // Parent node, node id, family, name, threshold, left, right
            sb.append(String.format("P,%d,%s,%s,%f,%d,%d", i, stump.featureFamily, stump.featureName, stump.threshold, stump.leftChild, stump.rightChild));
        } else {
            // Leaf node, node id, feature weight, human readable leaf name.
            sb.append(String.format("L,%d,%f,LEAF_%d", i, stump.featureWeight, i));
        }
        sb.append("\"\n");
    }
    sb.append("  ]\n");
    return sb.toString();
}
Also used : StringBuilder(java.lang.StringBuilder)

Example 34 with StringBuilder

use of java.lang.StringBuilder in project wire by square.

the class AllTypes method toString.

@Override
public String toString() {
    StringBuilder builder = new StringBuilder();
    builder.append(", int32=").append(int32);
    builder.append(", uint32=").append(uint32);
    builder.append(", sint32=").append(sint32);
    builder.append(", fixed32=").append(fixed32);
    builder.append(", sfixed32=").append(sfixed32);
    builder.append(", int64=").append(int64);
    builder.append(", uint64=").append(uint64);
    builder.append(", sint64=").append(sint64);
    builder.append(", fixed64=").append(fixed64);
    builder.append(", sfixed64=").append(sfixed64);
    builder.append(", bool=").append(bool);
    builder.append(", float=").append(float_);
    builder.append(", double=").append(double_);
    if (string != null)
        builder.append(", string=").append(Internal.sanitize(string));
    if (bytes != null)
        builder.append(", bytes=").append(bytes);
    if (nested_enum != null)
        builder.append(", nested_enum=").append(nested_enum);
    if (nested_message != null)
        builder.append(", nested_message=").append(nested_message);
    if (any != null)
        builder.append(", any=").append(any);
    if (duration != null)
        builder.append(", duration=").append(duration);
    if (struct != null)
        builder.append(", struct=").append(struct);
    if (list_value != null)
        builder.append(", list_value=").append(list_value);
    if (value != null)
        builder.append(", value=").append(value);
    if (null_value != null)
        builder.append(", null_value=").append(null_value);
    if (empty != null)
        builder.append(", empty=").append(empty);
    if (timestamp != null)
        builder.append(", timestamp=").append(timestamp);
    if (opt_int32 != null)
        builder.append(", opt_int32=").append(opt_int32);
    if (opt_uint32 != null)
        builder.append(", opt_uint32=").append(opt_uint32);
    if (opt_sint32 != null)
        builder.append(", opt_sint32=").append(opt_sint32);
    if (opt_fixed32 != null)
        builder.append(", opt_fixed32=").append(opt_fixed32);
    if (opt_sfixed32 != null)
        builder.append(", opt_sfixed32=").append(opt_sfixed32);
    if (opt_int64 != null)
        builder.append(", opt_int64=").append(opt_int64);
    if (opt_uint64 != null)
        builder.append(", opt_uint64=").append(opt_uint64);
    if (opt_sint64 != null)
        builder.append(", opt_sint64=").append(opt_sint64);
    if (opt_fixed64 != null)
        builder.append(", opt_fixed64=").append(opt_fixed64);
    if (opt_sfixed64 != null)
        builder.append(", opt_sfixed64=").append(opt_sfixed64);
    if (opt_bool != null)
        builder.append(", opt_bool=").append(opt_bool);
    if (opt_float != null)
        builder.append(", opt_float=").append(opt_float);
    if (opt_double != null)
        builder.append(", opt_double=").append(opt_double);
    if (opt_string != null)
        builder.append(", opt_string=").append(Internal.sanitize(opt_string));
    if (opt_bytes != null)
        builder.append(", opt_bytes=").append(opt_bytes);
    if (!rep_int32.isEmpty())
        builder.append(", rep_int32=").append(rep_int32);
    if (!rep_uint32.isEmpty())
        builder.append(", rep_uint32=").append(rep_uint32);
    if (!rep_sint32.isEmpty())
        builder.append(", rep_sint32=").append(rep_sint32);
    if (!rep_fixed32.isEmpty())
        builder.append(", rep_fixed32=").append(rep_fixed32);
    if (!rep_sfixed32.isEmpty())
        builder.append(", rep_sfixed32=").append(rep_sfixed32);
    if (!rep_int64.isEmpty())
        builder.append(", rep_int64=").append(rep_int64);
    if (!rep_uint64.isEmpty())
        builder.append(", rep_uint64=").append(rep_uint64);
    if (!rep_sint64.isEmpty())
        builder.append(", rep_sint64=").append(rep_sint64);
    if (!rep_fixed64.isEmpty())
        builder.append(", rep_fixed64=").append(rep_fixed64);
    if (!rep_sfixed64.isEmpty())
        builder.append(", rep_sfixed64=").append(rep_sfixed64);
    if (!rep_bool.isEmpty())
        builder.append(", rep_bool=").append(rep_bool);
    if (!rep_float.isEmpty())
        builder.append(", rep_float=").append(rep_float);
    if (!rep_double.isEmpty())
        builder.append(", rep_double=").append(rep_double);
    if (!rep_string.isEmpty())
        builder.append(", rep_string=").append(Internal.sanitize(rep_string));
    if (!rep_bytes.isEmpty())
        builder.append(", rep_bytes=").append(rep_bytes);
    if (!rep_nested_enum.isEmpty())
        builder.append(", rep_nested_enum=").append(rep_nested_enum);
    if (!rep_nested_message.isEmpty())
        builder.append(", rep_nested_message=").append(rep_nested_message);
    if (!rep_any.isEmpty())
        builder.append(", rep_any=").append(rep_any);
    if (!rep_duration.isEmpty())
        builder.append(", rep_duration=").append(rep_duration);
    if (!rep_struct.isEmpty())
        builder.append(", rep_struct=").append(rep_struct);
    if (!rep_list_value.isEmpty())
        builder.append(", rep_list_value=").append(rep_list_value);
    if (!rep_value.isEmpty())
        builder.append(", rep_value=").append(rep_value);
    if (!rep_null_value.isEmpty())
        builder.append(", rep_null_value=").append(rep_null_value);
    if (!rep_empty.isEmpty())
        builder.append(", rep_empty=").append(rep_empty);
    if (!rep_timestamp.isEmpty())
        builder.append(", rep_timestamp=").append(rep_timestamp);
    if (!pack_int32.isEmpty())
        builder.append(", pack_int32=").append(pack_int32);
    if (!pack_uint32.isEmpty())
        builder.append(", pack_uint32=").append(pack_uint32);
    if (!pack_sint32.isEmpty())
        builder.append(", pack_sint32=").append(pack_sint32);
    if (!pack_fixed32.isEmpty())
        builder.append(", pack_fixed32=").append(pack_fixed32);
    if (!pack_sfixed32.isEmpty())
        builder.append(", pack_sfixed32=").append(pack_sfixed32);
    if (!pack_int64.isEmpty())
        builder.append(", pack_int64=").append(pack_int64);
    if (!pack_uint64.isEmpty())
        builder.append(", pack_uint64=").append(pack_uint64);
    if (!pack_sint64.isEmpty())
        builder.append(", pack_sint64=").append(pack_sint64);
    if (!pack_fixed64.isEmpty())
        builder.append(", pack_fixed64=").append(pack_fixed64);
    if (!pack_sfixed64.isEmpty())
        builder.append(", pack_sfixed64=").append(pack_sfixed64);
    if (!pack_bool.isEmpty())
        builder.append(", pack_bool=").append(pack_bool);
    if (!pack_float.isEmpty())
        builder.append(", pack_float=").append(pack_float);
    if (!pack_double.isEmpty())
        builder.append(", pack_double=").append(pack_double);
    if (!pack_nested_enum.isEmpty())
        builder.append(", pack_nested_enum=").append(pack_nested_enum);
    if (!pack_null_value.isEmpty())
        builder.append(", pack_null_value=").append(pack_null_value);
    if (!map_int32_int32.isEmpty())
        builder.append(", map_int32_int32=").append(map_int32_int32);
    if (!map_string_string.isEmpty())
        builder.append(", map_string_string=").append(map_string_string);
    if (!map_string_message.isEmpty())
        builder.append(", map_string_message=").append(map_string_message);
    if (!map_string_enum.isEmpty())
        builder.append(", map_string_enum=").append(map_string_enum);
    if (!map_int32_any.isEmpty())
        builder.append(", map_int32_any=").append(map_int32_any);
    if (!map_int32_duration.isEmpty())
        builder.append(", map_int32_duration=").append(map_int32_duration);
    if (!map_int32_struct.isEmpty())
        builder.append(", map_int32_struct=").append(map_int32_struct);
    if (!map_int32_list_value.isEmpty())
        builder.append(", map_int32_list_value=").append(map_int32_list_value);
    if (!map_int32_value.isEmpty())
        builder.append(", map_int32_value=").append(map_int32_value);
    if (!map_int32_null_value.isEmpty())
        builder.append(", map_int32_null_value=").append(map_int32_null_value);
    if (!map_int32_empty.isEmpty())
        builder.append(", map_int32_empty=").append(map_int32_empty);
    if (!map_int32_timestamp.isEmpty())
        builder.append(", map_int32_timestamp=").append(map_int32_timestamp);
    if (oneof_string != null)
        builder.append(", oneof_string=").append(Internal.sanitize(oneof_string));
    if (oneof_int32 != null)
        builder.append(", oneof_int32=").append(oneof_int32);
    if (oneof_nested_message != null)
        builder.append(", oneof_nested_message=").append(oneof_nested_message);
    if (oneof_any != null)
        builder.append(", oneof_any=").append(oneof_any);
    if (oneof_duration != null)
        builder.append(", oneof_duration=").append(oneof_duration);
    if (oneof_struct != null)
        builder.append(", oneof_struct=").append(oneof_struct);
    if (oneof_list_value != null)
        builder.append(", oneof_list_value=").append(oneof_list_value);
    if (oneof_empty != null)
        builder.append(", oneof_empty=").append(oneof_empty);
    if (oneof_timestamp != null)
        builder.append(", oneof_timestamp=").append(oneof_timestamp);
    return builder.replace(0, 2, "AllTypes{").append('}').toString();
}
Also used : StringBuilder(java.lang.StringBuilder) Override(java.lang.Override)

Example 35 with StringBuilder

use of java.lang.StringBuilder in project wire by square.

the class AllTypes method toString.

@Override
public String toString() {
    StringBuilder builder = new StringBuilder();
    if (opt_int32 != null)
        builder.append(", opt_int32=").append(opt_int32);
    if (opt_uint32 != null)
        builder.append(", opt_uint32=").append(opt_uint32);
    if (opt_sint32 != null)
        builder.append(", opt_sint32=").append(opt_sint32);
    if (opt_fixed32 != null)
        builder.append(", opt_fixed32=").append(opt_fixed32);
    if (opt_sfixed32 != null)
        builder.append(", opt_sfixed32=").append(opt_sfixed32);
    if (opt_int64 != null)
        builder.append(", opt_int64=").append(opt_int64);
    if (opt_uint64 != null)
        builder.append(", opt_uint64=").append(opt_uint64);
    if (opt_sint64 != null)
        builder.append(", opt_sint64=").append(opt_sint64);
    if (opt_fixed64 != null)
        builder.append(", opt_fixed64=").append(opt_fixed64);
    if (opt_sfixed64 != null)
        builder.append(", opt_sfixed64=").append(opt_sfixed64);
    if (opt_bool != null)
        builder.append(", opt_bool=").append(opt_bool);
    if (opt_float != null)
        builder.append(", opt_float=").append(opt_float);
    if (opt_double != null)
        builder.append(", opt_double=").append(opt_double);
    if (opt_string != null)
        builder.append(", opt_string=").append(Internal.sanitize(opt_string));
    if (opt_bytes != null)
        builder.append(", opt_bytes=").append(opt_bytes);
    if (opt_nested_enum != null)
        builder.append(", opt_nested_enum=").append(opt_nested_enum);
    if (opt_nested_message != null)
        builder.append(", opt_nested_message=").append(opt_nested_message);
    builder.append(", req_int32=").append(req_int32);
    builder.append(", req_uint32=").append(req_uint32);
    builder.append(", req_sint32=").append(req_sint32);
    builder.append(", req_fixed32=").append(req_fixed32);
    builder.append(", req_sfixed32=").append(req_sfixed32);
    builder.append(", req_int64=").append(req_int64);
    builder.append(", req_uint64=").append(req_uint64);
    builder.append(", req_sint64=").append(req_sint64);
    builder.append(", req_fixed64=").append(req_fixed64);
    builder.append(", req_sfixed64=").append(req_sfixed64);
    builder.append(", req_bool=").append(req_bool);
    builder.append(", req_float=").append(req_float);
    builder.append(", req_double=").append(req_double);
    builder.append(", req_string=").append(Internal.sanitize(req_string));
    builder.append(", req_bytes=").append(req_bytes);
    builder.append(", req_nested_enum=").append(req_nested_enum);
    builder.append(", req_nested_message=").append(req_nested_message);
    if (!rep_int32.isEmpty())
        builder.append(", rep_int32=").append(rep_int32);
    if (!rep_uint32.isEmpty())
        builder.append(", rep_uint32=").append(rep_uint32);
    if (!rep_sint32.isEmpty())
        builder.append(", rep_sint32=").append(rep_sint32);
    if (!rep_fixed32.isEmpty())
        builder.append(", rep_fixed32=").append(rep_fixed32);
    if (!rep_sfixed32.isEmpty())
        builder.append(", rep_sfixed32=").append(rep_sfixed32);
    if (!rep_int64.isEmpty())
        builder.append(", rep_int64=").append(rep_int64);
    if (!rep_uint64.isEmpty())
        builder.append(", rep_uint64=").append(rep_uint64);
    if (!rep_sint64.isEmpty())
        builder.append(", rep_sint64=").append(rep_sint64);
    if (!rep_fixed64.isEmpty())
        builder.append(", rep_fixed64=").append(rep_fixed64);
    if (!rep_sfixed64.isEmpty())
        builder.append(", rep_sfixed64=").append(rep_sfixed64);
    if (!rep_bool.isEmpty())
        builder.append(", rep_bool=").append(rep_bool);
    if (!rep_float.isEmpty())
        builder.append(", rep_float=").append(rep_float);
    if (!rep_double.isEmpty())
        builder.append(", rep_double=").append(rep_double);
    if (!rep_string.isEmpty())
        builder.append(", rep_string=").append(Internal.sanitize(rep_string));
    if (!rep_bytes.isEmpty())
        builder.append(", rep_bytes=").append(rep_bytes);
    if (!rep_nested_enum.isEmpty())
        builder.append(", rep_nested_enum=").append(rep_nested_enum);
    if (!rep_nested_message.isEmpty())
        builder.append(", rep_nested_message=").append(rep_nested_message);
    if (!pack_int32.isEmpty())
        builder.append(", pack_int32=").append(pack_int32);
    if (!pack_uint32.isEmpty())
        builder.append(", pack_uint32=").append(pack_uint32);
    if (!pack_sint32.isEmpty())
        builder.append(", pack_sint32=").append(pack_sint32);
    if (!pack_fixed32.isEmpty())
        builder.append(", pack_fixed32=").append(pack_fixed32);
    if (!pack_sfixed32.isEmpty())
        builder.append(", pack_sfixed32=").append(pack_sfixed32);
    if (!pack_int64.isEmpty())
        builder.append(", pack_int64=").append(pack_int64);
    if (!pack_uint64.isEmpty())
        builder.append(", pack_uint64=").append(pack_uint64);
    if (!pack_sint64.isEmpty())
        builder.append(", pack_sint64=").append(pack_sint64);
    if (!pack_fixed64.isEmpty())
        builder.append(", pack_fixed64=").append(pack_fixed64);
    if (!pack_sfixed64.isEmpty())
        builder.append(", pack_sfixed64=").append(pack_sfixed64);
    if (!pack_bool.isEmpty())
        builder.append(", pack_bool=").append(pack_bool);
    if (!pack_float.isEmpty())
        builder.append(", pack_float=").append(pack_float);
    if (!pack_double.isEmpty())
        builder.append(", pack_double=").append(pack_double);
    if (!pack_nested_enum.isEmpty())
        builder.append(", pack_nested_enum=").append(pack_nested_enum);
    if (default_int32 != null)
        builder.append(", default_int32=").append(default_int32);
    if (default_uint32 != null)
        builder.append(", default_uint32=").append(default_uint32);
    if (default_sint32 != null)
        builder.append(", default_sint32=").append(default_sint32);
    if (default_fixed32 != null)
        builder.append(", default_fixed32=").append(default_fixed32);
    if (default_sfixed32 != null)
        builder.append(", default_sfixed32=").append(default_sfixed32);
    if (default_int64 != null)
        builder.append(", default_int64=").append(default_int64);
    if (default_uint64 != null)
        builder.append(", default_uint64=").append(default_uint64);
    if (default_sint64 != null)
        builder.append(", default_sint64=").append(default_sint64);
    if (default_fixed64 != null)
        builder.append(", default_fixed64=").append(default_fixed64);
    if (default_sfixed64 != null)
        builder.append(", default_sfixed64=").append(default_sfixed64);
    if (default_bool != null)
        builder.append(", default_bool=").append(default_bool);
    if (default_float != null)
        builder.append(", default_float=").append(default_float);
    if (default_double != null)
        builder.append(", default_double=").append(default_double);
    if (default_string != null)
        builder.append(", default_string=").append(Internal.sanitize(default_string));
    if (default_bytes != null)
        builder.append(", default_bytes=").append(default_bytes);
    if (default_nested_enum != null)
        builder.append(", default_nested_enum=").append(default_nested_enum);
    if (!map_int32_int32.isEmpty())
        builder.append(", map_int32_int32=").append(map_int32_int32);
    if (!map_string_string.isEmpty())
        builder.append(", map_string_string=").append(map_string_string);
    if (!map_string_message.isEmpty())
        builder.append(", map_string_message=").append(map_string_message);
    if (!map_string_enum.isEmpty())
        builder.append(", map_string_enum=").append(map_string_enum);
    if (ext_opt_int32 != null)
        builder.append(", ext_opt_int32=").append(ext_opt_int32);
    if (ext_opt_uint32 != null)
        builder.append(", ext_opt_uint32=").append(ext_opt_uint32);
    if (ext_opt_sint32 != null)
        builder.append(", ext_opt_sint32=").append(ext_opt_sint32);
    if (ext_opt_fixed32 != null)
        builder.append(", ext_opt_fixed32=").append(ext_opt_fixed32);
    if (ext_opt_sfixed32 != null)
        builder.append(", ext_opt_sfixed32=").append(ext_opt_sfixed32);
    if (ext_opt_int64 != null)
        builder.append(", ext_opt_int64=").append(ext_opt_int64);
    if (ext_opt_uint64 != null)
        builder.append(", ext_opt_uint64=").append(ext_opt_uint64);
    if (ext_opt_sint64 != null)
        builder.append(", ext_opt_sint64=").append(ext_opt_sint64);
    if (ext_opt_fixed64 != null)
        builder.append(", ext_opt_fixed64=").append(ext_opt_fixed64);
    if (ext_opt_sfixed64 != null)
        builder.append(", ext_opt_sfixed64=").append(ext_opt_sfixed64);
    if (ext_opt_bool != null)
        builder.append(", ext_opt_bool=").append(ext_opt_bool);
    if (ext_opt_float != null)
        builder.append(", ext_opt_float=").append(ext_opt_float);
    if (ext_opt_double != null)
        builder.append(", ext_opt_double=").append(ext_opt_double);
    if (ext_opt_string != null)
        builder.append(", ext_opt_string=").append(Internal.sanitize(ext_opt_string));
    if (ext_opt_bytes != null)
        builder.append(", ext_opt_bytes=").append(ext_opt_bytes);
    if (ext_opt_nested_enum != null)
        builder.append(", ext_opt_nested_enum=").append(ext_opt_nested_enum);
    if (ext_opt_nested_message != null)
        builder.append(", ext_opt_nested_message=").append(ext_opt_nested_message);
    if (!ext_rep_int32.isEmpty())
        builder.append(", ext_rep_int32=").append(ext_rep_int32);
    if (!ext_rep_uint32.isEmpty())
        builder.append(", ext_rep_uint32=").append(ext_rep_uint32);
    if (!ext_rep_sint32.isEmpty())
        builder.append(", ext_rep_sint32=").append(ext_rep_sint32);
    if (!ext_rep_fixed32.isEmpty())
        builder.append(", ext_rep_fixed32=").append(ext_rep_fixed32);
    if (!ext_rep_sfixed32.isEmpty())
        builder.append(", ext_rep_sfixed32=").append(ext_rep_sfixed32);
    if (!ext_rep_int64.isEmpty())
        builder.append(", ext_rep_int64=").append(ext_rep_int64);
    if (!ext_rep_uint64.isEmpty())
        builder.append(", ext_rep_uint64=").append(ext_rep_uint64);
    if (!ext_rep_sint64.isEmpty())
        builder.append(", ext_rep_sint64=").append(ext_rep_sint64);
    if (!ext_rep_fixed64.isEmpty())
        builder.append(", ext_rep_fixed64=").append(ext_rep_fixed64);
    if (!ext_rep_sfixed64.isEmpty())
        builder.append(", ext_rep_sfixed64=").append(ext_rep_sfixed64);
    if (!ext_rep_bool.isEmpty())
        builder.append(", ext_rep_bool=").append(ext_rep_bool);
    if (!ext_rep_float.isEmpty())
        builder.append(", ext_rep_float=").append(ext_rep_float);
    if (!ext_rep_double.isEmpty())
        builder.append(", ext_rep_double=").append(ext_rep_double);
    if (!ext_rep_string.isEmpty())
        builder.append(", ext_rep_string=").append(Internal.sanitize(ext_rep_string));
    if (!ext_rep_bytes.isEmpty())
        builder.append(", ext_rep_bytes=").append(ext_rep_bytes);
    if (!ext_rep_nested_enum.isEmpty())
        builder.append(", ext_rep_nested_enum=").append(ext_rep_nested_enum);
    if (!ext_rep_nested_message.isEmpty())
        builder.append(", ext_rep_nested_message=").append(ext_rep_nested_message);
    if (!ext_pack_int32.isEmpty())
        builder.append(", ext_pack_int32=").append(ext_pack_int32);
    if (!ext_pack_uint32.isEmpty())
        builder.append(", ext_pack_uint32=").append(ext_pack_uint32);
    if (!ext_pack_sint32.isEmpty())
        builder.append(", ext_pack_sint32=").append(ext_pack_sint32);
    if (!ext_pack_fixed32.isEmpty())
        builder.append(", ext_pack_fixed32=").append(ext_pack_fixed32);
    if (!ext_pack_sfixed32.isEmpty())
        builder.append(", ext_pack_sfixed32=").append(ext_pack_sfixed32);
    if (!ext_pack_int64.isEmpty())
        builder.append(", ext_pack_int64=").append(ext_pack_int64);
    if (!ext_pack_uint64.isEmpty())
        builder.append(", ext_pack_uint64=").append(ext_pack_uint64);
    if (!ext_pack_sint64.isEmpty())
        builder.append(", ext_pack_sint64=").append(ext_pack_sint64);
    if (!ext_pack_fixed64.isEmpty())
        builder.append(", ext_pack_fixed64=").append(ext_pack_fixed64);
    if (!ext_pack_sfixed64.isEmpty())
        builder.append(", ext_pack_sfixed64=").append(ext_pack_sfixed64);
    if (!ext_pack_bool.isEmpty())
        builder.append(", ext_pack_bool=").append(ext_pack_bool);
    if (!ext_pack_float.isEmpty())
        builder.append(", ext_pack_float=").append(ext_pack_float);
    if (!ext_pack_double.isEmpty())
        builder.append(", ext_pack_double=").append(ext_pack_double);
    if (!ext_pack_nested_enum.isEmpty())
        builder.append(", ext_pack_nested_enum=").append(ext_pack_nested_enum);
    return builder.replace(0, 2, "AllTypes{").append('}').toString();
}
Also used : StringBuilder(java.lang.StringBuilder) Override(java.lang.Override)

Aggregations

StringBuilder (java.lang.StringBuilder)40 Override (java.lang.Override)9 String (java.lang.String)6 IOException (java.io.IOException)5 BufferedReader (java.io.BufferedReader)4 BufferedWriter (java.io.BufferedWriter)2 File (java.io.File)2 NumberFormatException (java.lang.NumberFormatException)2 Object (java.lang.Object)2 ArrayList (java.util.ArrayList)2 Chromosome (PedigreeSim.Chromosome)1 Individual (PedigreeSim.Individual)1 Locus (PedigreeSim.Locus)1 Rational (android.util.Rational)1 Digest (cz1.gbs.core.Digest)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 FileReader (java.io.FileReader)1 InputStreamReader (java.io.InputStreamReader)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 RuntimeException (java.lang.RuntimeException)1