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

brooklyn.rest.domain.EntityConfigSummary Maven / Gradle / Ivy

The newest version!
package brooklyn.rest.domain;

import brooklyn.config.ConfigKey;
import com.google.common.collect.ImmutableMap;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;

import java.net.URI;
import java.util.List;
import java.util.Map;

public class EntityConfigSummary extends ConfigSummary {

  @JsonSerialize(include=Inclusion.NON_NULL)
  private final Map links;

  public EntityConfigSummary(
      @JsonProperty("name") String name,
      @JsonProperty("type") String type,
      @JsonProperty("description") String description,
      @JsonProperty("defaultValue") Object defaultValue,
      @JsonProperty("reconfigurable") boolean reconfigurable,
      @JsonProperty("label") String label,
      @JsonProperty("priority") Double priority,
      @JsonProperty("possibleValues") List> possibleValues,
      @JsonProperty("links") Map links
  ) {
    super(name, type, description, defaultValue, reconfigurable, label, priority, possibleValues);
    this.links = links!=null ? ImmutableMap.copyOf(links) : null;
  }

  public EntityConfigSummary(ConfigKey config, String label, Double priority, Map links) {
    super(config, label, priority);
    this.links = links!=null ? ImmutableMap.copyOf(links) : null;
  }

  @Override
  public Map getLinks() {
    return links;
  }

  @Override
  public String toString() {
    return "EntityConfigSummary{" +
        "name='" + getName() + '\'' +
        ", type='" + getType() + '\'' +
        '}';
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy