Search in sources :

Example 6 with JsonValue

use of com.fasterxml.jackson.annotation.JsonValue in project graylog2-server by Graylog2.

the class ConfigurationRequest method asList.

@JsonValue
public Map<String, Map<String, Object>> asList() {
    final Map<String, Map<String, Object>> configs = Maps.newLinkedHashMap();
    for (ConfigurationField f : fields.values()) {
        final Map<String, Object> config = Maps.newHashMap();
        config.put("type", f.getFieldType());
        config.put("human_name", f.getHumanName());
        config.put("description", f.getDescription());
        config.put("default_value", f.getDefaultValue());
        config.put("is_optional", f.isOptional().equals(ConfigurationField.Optional.OPTIONAL));
        config.put("attributes", f.getAttributes());
        config.put("additional_info", f.getAdditionalInformation());
        configs.put(f.getName(), config);
    }
    return configs;
}
Also used : ConfigurationField(org.graylog2.plugin.configuration.fields.ConfigurationField) Map(java.util.Map) JsonValue(com.fasterxml.jackson.annotation.JsonValue)

Aggregations

JsonValue (com.fasterxml.jackson.annotation.JsonValue)6 ByteBuffer (java.nio.ByteBuffer)4 ByteArrayDataOutput (com.google.common.io.ByteArrayDataOutput)1 Map (java.util.Map)1 ConfigurationField (org.graylog2.plugin.configuration.fields.ConfigurationField)1