/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.text;

import java.io.Serializable;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public class StrBuilderOptions implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    private static final byte[] EMPTY = new byte[0];
    
    protected StrBuilderOptions() {
        // do nothing
    }
    
    public StrBuilder builder() {
        throw new UnsupportedOperationException();
    }
    
    public String blank() {
        return null;
    }

    public StrBuilderOptions blank(String value) {
        throw new UnsupportedOperationException();
    }

    public String endl() {
        return StringUtils.ENDL;
    }

    public StrBuilderOptions endl(String value) {
        throw new UnsupportedOperationException();
    }

    public String separator() {
        return ", ";
    }

    public StrBuilderOptions separator(String value) {
        throw new UnsupportedOperationException();
    }

    public String open() {
        return null;
    }

    public StrBuilderOptions open(String open) {
        throw new UnsupportedOperationException();
    }

    public String close() {
        return null;
    }

    public StrBuilderOptions close(String close) {
        throw new UnsupportedOperationException();
    }

    @Override
    public String toString() {
        String b = hex(blank());
        String e = hex(endl());
        String s = hex(separator());
        String o = hex(open());
        String c = hex(close());
        return "{ blank='" + b + "', endl='" + e + "', separator='" + s + "', open='" + o + "', close='" + c + "' }";
    }
    
    private static String hex(String s) {
        return FormatHex.format(null == s ? EMPTY : s.getBytes(Charsets.UTF8));
    }
    
}
