All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.lindstrom.m3u8.util.AttributeListBuilder Maven / Gradle / Ivy

There is a newer version: 0.28
Show newest version
package io.lindstrom.m3u8.util;

import java.util.ArrayList;
import java.util.List;

public class AttributeListBuilder {
    private final List attributes = new ArrayList<>();

    public void add(String key, Enum value) {
        attributes.add(String.format("%s=%s", key, value));
    }

    public void add(String key, String value) {
        attributes.add(String.format("%s=%s", key, value));
    }

    public void add(String key, boolean value) {
        attributes.add(String.format("%s=%s", key, value ? "YES" : "NO"));
    }

    public void addQuoted(String key, Object value) {
        attributes.add(String.format("%s=\"%s\"", key, value));
    }

    @Override
    public String toString() {
        return String.join(",", attributes);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy