Java 8 StringBuilder - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 StringBuilder class.

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
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: append, toString
            final long syncState = !contact.isNull("x") ? contact.getLong("x") : 0;
            return new RawContact(userName, null, firstName, lastName, cellPhone,
                    officePhone, homePhone, email, status, avatarUrl, deleted,
                    serverContactId, rawContactId, syncState, false);
        } catch (final Exception ex) {
            Log.i(TAG, "Error parsing JSON contact object" + ex.toString());
        } 
        return null; 
    } 
 
    /** 
     * Creates and returns RawContact instance from all the supplied parameters. 
     */ 
    public static RawContact create(String fullName, String firstName, String lastName,
            String cellPhone, String officePhone, String homePhone,
            String email, String status, boolean deleted, long rawContactId,
            long serverContactId) {
        return new RawContact(null, fullName, firstName, lastName, cellPhone, officePhone,
                homePhone, email, status, null, deleted, serverContactId, rawContactId,
                -1, true); 
Full Snippet Info
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: append, toString
    } 
  } 
 
  @Override 
  protected Dialog onCreateDialog(int id) {
    Log.d(TAG, "onCreateDialog(" +id+")");
 
    switch (id) {
      case RUBY_LOADING:
        ProgressDialog d = new ProgressDialog(this);
        d.setTitle("Loading JRuby");
        d.setMessage("Please wait");
        d.setIndeterminate(true);
        d.setCancelable(false);
        return d;
      default: 
        return null; 
     } 
  } 
 
Full Snippet Info
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: append, toString
    public void switchToPortrait(Camera camera, CameraContext context) {
        error("rotate"); 
    } 
     
    private void error(String method) {
        StringBuilder msg = new StringBuilder(100);
        msg.append("Method ");
        msg.append(method);
        msg.append(" is not valid in current state");
 
        DebugOut.logError(msg.toString());
    } 
} 
Full Snippet Info
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: append, toString
		type = t;
		score = s;
	} 
 
	public final String toString() {
		return type+":"+score.toString();
	} 
 
	public static final String toString(String t, Score s) {
		return t+":"+s.toString();
	} 
 
	public static final BlockRef parse(String s) {
		if (s == null)
			s = "";
 
		String s2[] = s.split(":");
		if (s2.length == 3)
			return new BlockRef(s2[0], new Score(s2[1], s2[2]));
 
Full Snippet Info
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

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: