/*
 * 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, 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;
    }
    
}

@@ -1095,15 +1095,298 @@
 ;%0A    %7D%0A
+%0A
     
+public void addParameter(String parameter) %7B%0A        //Check if no parameters%0A        if (parameters!=null && !parameters.isEmpty())%0A            //append separator%0A            parameters += %22;%22 + parameter;%0A        else%0A            //Set it%0A            parameters = parameter;%0A    %7D
 %0A%7D%0A

Add FormatAttribute helper methods