universe@127: /* universe@127: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. universe@127: * universe@127: * Copyright 2020 Mike Becker. All rights reserved. universe@127: * universe@127: * Redistribution and use in source and binary forms, with or without universe@127: * modification, are permitted provided that the following conditions are met: universe@127: * universe@127: * 1. Redistributions of source code must retain the above copyright universe@127: * notice, this list of conditions and the following disclaimer. universe@127: * universe@127: * 2. Redistributions in binary form must reproduce the above copyright universe@127: * notice, this list of conditions and the following disclaimer in the universe@127: * documentation and/or other materials provided with the distribution. universe@127: * universe@127: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" universe@127: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE universe@127: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE universe@127: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE universe@127: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR universe@127: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF universe@127: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS universe@127: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN universe@127: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) universe@127: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE universe@127: * POSSIBILITY OF SUCH DAMAGE. universe@127: * universe@127: */ universe@127: package de.uapcore.lightpit.entities; universe@127: universe@127: import de.uapcore.lightpit.types.WebColor; universe@127: universe@127: import java.util.Objects; universe@127: universe@127: public final class Component { universe@127: universe@127: private final int id; universe@127: universe@127: private String name; universe@127: universe@127: private WebColor color; universe@127: universe@127: private int ordinal = 0; universe@127: universe@127: private String description = null; universe@127: universe@127: private User lead = null; universe@127: universe@127: /** universe@127: * Sole constructor. universe@127: * @param id the ID of the component universe@127: */ universe@127: public Component(int id) { universe@127: this.id = id; universe@127: } universe@127: universe@127: public int getId() { universe@127: return id; universe@127: } universe@127: universe@127: public String getName() { universe@127: return name; universe@127: } universe@127: universe@127: public void setName(String name) { universe@127: this.name = name; universe@127: } universe@127: universe@127: public WebColor getColor() { universe@127: return color; universe@127: } universe@127: universe@127: public void setColor(WebColor color) { universe@127: this.color = color; universe@127: } universe@127: universe@127: public int getOrdinal() { universe@127: return ordinal; universe@127: } universe@127: universe@127: public void setOrdinal(int ordinal) { universe@127: this.ordinal = ordinal; universe@127: } universe@127: universe@127: public String getDescription() { universe@127: return description; universe@127: } universe@127: universe@127: public void setDescription(String description) { universe@127: this.description = description; universe@127: } universe@127: universe@127: public User getLead() { universe@127: return lead; universe@127: } universe@127: universe@127: public void setLead(User lead) { universe@127: this.lead = lead; universe@127: } universe@127: universe@127: @Override universe@127: public boolean equals(Object o) { universe@127: if (this == o) return true; universe@127: if (o == null || getClass() != o.getClass()) return false; universe@127: Component component = (Component) o; universe@127: return id == component.id; universe@127: } universe@127: universe@127: @Override universe@127: public int hashCode() { universe@127: return Objects.hash(id); universe@127: } universe@127: }