package com.example.cosmosclient; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.ArrayList; import java.util.HashMap; public class Container2 { private HashMap<String, Component> components = new HashMap<>(); public HashMap<String, Component> getComponents() { return components; } public void setComponents(HashMap<String, Component> components) { this.components = components; } public void putComponent(String key, Component c) { components.put(key, c); } public Component getComponent(int index) { return components.get(index); } public void removeComponent(int index) { components.remove(index); } @JsonIgnore public int getComponentsCount() { return components.size(); } @Override public boolean equals(Object other) { if (!(other instanceof Container2)) return false; return components.equals(((Container2)other).components); } }