View Javadoc
1   package org.synchronoss.cpo.core.meta.bean;
2   
3   /*-
4    * [[
5    * core
6    * ==
7    * Copyright (C) 2003 - 2026 Exaxis LLC, Synchronoss Technologies Inc
8    * ==
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser General Public License as
11   * published by the Free Software Foundation, either version 3 of the
12   * License, or (at your option) any later version.
13   *
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Lesser Public License for more details.
18   *
19   * You should have received a copy of the GNU General Lesser Public
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
22   * ]]
23   */
24  
25  /**
26   * Plain-data holder for the fields of a CPO function group as loaded from meta XML: the group's
27   * name (inherited from {@link CpoClassBean}) and its CRUD type (INSERT, RETRIEVE, UPDATE, DELETE,
28   * EXIST, EXECUTE). {@link org.synchronoss.cpo.core.meta.domain.CpoFunctionGroup} extends this with
29   * the runtime behavior (its list of functions).
30   *
31   * @author dberry
32   */
33  public class CpoFunctionGroupBean extends CpoClassBean {
34  
35    /** Version Id for this class. */
36    private static final long serialVersionUID = 1L;
37  
38    /*
39     * Properties
40     */
41    /** The CRUD type of this function group (e.g. {@code INSERT}, {@code RETRIEVE}). */
42    private String type;
43  
44    /** Creates an empty instance. */
45    public CpoFunctionGroupBean() {}
46  
47    /**
48     * Gets the CRUD type of this function group (e.g. {@code INSERT}, {@code RETRIEVE}).
49     *
50     * @return the CRUD type name
51     */
52    public String getType() {
53      return type;
54    }
55  
56    /**
57     * Sets the CRUD type of this function group.
58     *
59     * @param type the CRUD type name
60     */
61    public void setType(String type) {
62      this.type = type;
63    }
64  
65    @Override
66    public int hashCode() {
67      int result = 0;
68      result = 31 * result + super.hashCode();
69      result = 31 * result + (getType() != null ? getType().hashCode() : 0);
70      return result;
71    }
72  
73    @Override
74    public String toString() {
75      StringBuilder str = new StringBuilder();
76      str.append(super.toString());
77      str.append("type = " + getType() + "\n");
78      return str.toString();
79    }
80  
81    @Override
82    public boolean equals(Object o) {
83      if (this == o) return true;
84  
85      if (o == null || getClass() != o.getClass()) return false;
86  
87      CpoFunctionGroupBean that = (CpoFunctionGroupBean) o;
88  
89      if (!super.equals(that)) return false;
90  
91      return getType() != null ? getType().equals(that.getType()) : that.getType() == null;
92    }
93  }