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

de.tsl2.nano.h5.websocket.dialog.IHtmlItem Maven / Gradle / Ivy

package de.tsl2.nano.h5.websocket.dialog;

import java.util.HashMap;
import java.util.Map;

public interface IHtmlItem {
    String getTag();
    String getId();
    String getName();
    Object getValue();
    Map getSpecificAttributes();
    default boolean hasLabel() { return true;}
    default String getContent() {return null;}

    default Map getAttributes() {
        Map attrs = new HashMap<>();
        attrs.put("id", getId());
        attrs.put("name", getName());
        attrs.put("value", String.valueOf(getValue()));
        getSpecificAttributes().keySet().stream().forEach(k -> attrs.put(k, String.valueOf(getSpecificAttributes().get(k))));
        return attrs;
    }
    
    default String toHtml() {
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy