<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.murillo.sdp;

/**
 *
 * @author Sergio
 */
public class FormatAttribute implements Attribute {

    private Integer fmt;
    private String parameters;

    public FormatAttribute() {
    }

    public FormatAttribute(Integer fmt) {
        this.fmt = fmt;
        this.parameters = null;
    }

    public FormatAttribute(Integer fmt, String parameters) {
        this.fmt = fmt;
        this.parameters = parameters;
    }
    
    @Override
    public String getField() {
        return "fmtp";
    }

    @Override
    public String getValue() {
        return fmt + " " + parameters;
    }

    @Override
    public String toString() {
        //Get value
        String value = getValue();
        //Generic attr
        return "a="+ getField() + (value!=null ? ":" + value : "") + "\r\n";
    }

    public Integer getFmt() {
        return fmt;
    }

    public void setFmt(Integer fmt) {
        this.fmt = fmt;
    }

    public String getParameters() {
        return parameters;
    }

    public void setParameters(String parameters) {
        this.parameters = parameters;
    }

    public void addParameter(String parameter) {
        //Check if no parameters
        if (parameters!=null && !parameters.isEmpty())
            //append separator
            parameters += "; " + parameter;
        else
            //Set it
            parameters = parameter;
    }
    public void addParameter(String key,String val) {
        addParameter(key+"="+val);
    }
    public void addParameter(String key,Integer val) {
        addParameter(key,val.toString());
    }
}<commit_msg>Fixed session-expire number format exception<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.murillo.sdp;

/**
 *
 * @author Sergio
 */
public class FormatAttribute implements Attribute {

    private Integer fmt;
    private String parameters;

    public FormatAttribute() {
    }

    public FormatAttribute(Integer fmt) {
        this.fmt = fmt;
        this.parameters = null;
    }

    public FormatAttribute(Integer fmt, String parameters) {
        this.fmt = fmt;
        this.parameters = parameters;
    }
    
    @Override
    public String getField() {
        return "fmtp";
    }

    @Override
    public String getValue() {
        return fmt + " " + parameters;
    }

    @Override
    public String toString() {
        //Get value
        String value = getValue();
        //Generic attr
        return "a="+ getField() + (value!=null ? ":" + value : "") + "\r\n";
    }

    public Integer getFmt() {
        return fmt;
    }

    public void setFmt(Integer fmt) {
        this.fmt = fmt;
    }

    public String getParameters() {
        return parameters;
    }

    public void setParameters(String parameters) {
        this.parameters = parameters;
    }

    public void addParameter(String parameter) {
        //Check if no parameters
        if (parameters!=null && !parameters.isEmpty())
            //append separator
            parameters += "; " + parameter;
        else
            //Set it
            parameters = parameter;
    }
    public void addParameter(String key,String val) {
        addParameter(key+"="+val);
    }
    public void addParameter(String key,Integer val) {
        addParameter(key,val.toString());
    }

    public boolean isEmpty() {
	return parameters!=null ? parameters.isEmpty() : true;
    }


}
{'fraction_non_alphanumeric': 0.1078129375525063, 'fraction_numerical': 0.0, 'mean_word_length': 2.0740103270223753, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3735094', 'n_tokens_mistral': 968, 'n_tokens_neox': 944, 'n_words': 275}