Best code examples for Java 8 StringBuilder class (java.lang.StringBuilder)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 StringBuilder class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 StringBuilder examples from Open Source projects
This code example shows how to use the following methods: append, toString
        return data;
    } 
 
    @Override 
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("ProtectionSpecificHeader");
        sb.append("{data=");
        ByteBuffer data = getData().duplicate();
        data.rewind();
        byte[] bytes = new byte[data.limit()];
        data.get(bytes);
        sb.append(Hex.encodeHex(bytes));
        sb.append('}');
        return sb.toString();
    } 
} 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: append, toString
 
    public abstract String name();
 
    @Override 
    public String toString() {
        return "(Name: " + name() + " Operator Key: " + mKey + ")";
    } 
     
    /** 
     * Compares to Operators based on their opKey 
     */ 
    @Override 
    public boolean equals(Object obj) { 
        if(obj==this)
            return true; 
        else 
            return false; 
    } 
     
    /** 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: append, toString
This code example shows how to use the following methods: append, toString
        @Override 
        public String toString() {
            StringBuilder sb = new StringBuilder();
            sb.append(mInputColumn);
            if (mCast) {
                sb.append(" cast to: " + DataType.findTypeName(mCastType));
            } 
            return sb.toString();
        } 
    } 
} 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: append, toString
 
            // Get list of columns in old table 
            List<String> columns = getColumns(db, tableName);
 
            // Backup original table 
            String alterQuery = "alter table " + tableName + " rename to 'temp_" + tableName + "'";
            db.execSQL(alterQuery);
 
            // Recreate table with new schema 
            db.execSQL(dbCreateIfNotExists);
 
            // Get intersection with new columns taken from upgraded table 
            columns.retainAll(getColumns(db, tableName));
 
            // Restore the data 
            String cols = join(columns, ",");
            db.execSQL(String.format("insert into %s (%s) select %s from temp_%s", tableName, cols, cols, tableName));
 
            // Remove backup table 
            db.execSQL("drop table 'temp_" + tableName + "'");
Full Snippet Info
6
CodeRank
Related Java 8 StringBuilder Questions & Answers:
Other Java 8 StringBuilder Examples
9:	  try {
10:	    reader = new BufferedReader(new FileReader(file));
11:	    StringBuilder builder = new StringBuilder();
12:	    String line;
13:	    while ((line = reader.readLine()) != null) {
-
9:	  try {
10:	    reader = new BufferedReader(new FileReader(file));
11:	    StringBuilder builder = new StringBuilder();
12:	    String line;
13:	    while ((line = reader.readLine()) != null) {

Read More

54:				BufferedReader reader = new BufferedReader(new InputStreamReader(
55:						is, "iso-8859-1"), 8);
56:				StringBuilder sb = new StringBuilder();
57:				String line = null;
58:				while ((line = reader.readLine()) != null) {
-
54:				BufferedReader reader = new BufferedReader(new InputStreamReader(
55:						is, "iso-8859-1"), 8);
56:				StringBuilder sb = new StringBuilder();
57:				String line = null;
58:				while ((line = reader.readLine()) != null) {

Read More

89:				BufferedReader reader = new BufferedReader(new InputStreamReader(
90:						is, "UTF-8"), 8);
91:				StringBuilder sb = new StringBuilder();
92:				String line = null;
93:				while ((line = reader.readLine()) != null) {
-
89:				BufferedReader reader = new BufferedReader(new InputStreamReader(
90:						is, "UTF-8"), 8);
91:				StringBuilder sb = new StringBuilder();
92:				String line = null;
93:				while ((line = reader.readLine()) != null) {

Read More

78:	    }
79:	
80:	    /**
81:	     * Unregister this account/device pair within the server.
82:	     */
-
78:	    }
79:	
80:	    /**
81:	     * Unregister this account/device pair within the server.
82:	     */

Read More

See Code Examples for Java 8 StringBuilder Methods: