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

com.capitalone.dashboard.model.Widget Maven / Gradle / Ivy

There is a newer version: 4.0.2
Show newest version
package com.capitalone.dashboard.model;

import org.bson.types.ObjectId;

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

/**
 * Represents a widget on the dashboard. Each widget is associated with a specific component. The id, name and options
 * should be provided by the UI.
 */
public class Widget {
    private ObjectId id;
    private String name;
    private ObjectId componentId;
    private Map options = new HashMap<>();

    public ObjectId getId() {
        return id;
    }

    public void setId(ObjectId id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ObjectId getComponentId() {
        return componentId;
    }

    public void setComponentId(ObjectId componentId) {
        this.componentId = componentId;
    }

    public Map getOptions() {
        return options;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Widget widget = (Widget) o;

        return id.equals(widget.id);
    }

    @Override
    public int hashCode() {
        return id.hashCode();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy