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    /*
36     * Properties
37     */
38    /** The CRUD type of this function group (e.g. {@code INSERT}, {@code RETRIEVE}). */
39    private String type;
40  
41    /** Creates an empty instance. */
42    public CpoFunctionGroupBean() {}
43  
44    /**
45     * Gets the CRUD type of this function group (e.g. {@code INSERT}, {@code RETRIEVE}).
46     *
47     * @return the CRUD type name
48     */
49    public String getType() {
50      return type;
51    }
52  
53    /**
54     * Sets the CRUD type of this function group.
55     *
56     * @param type the CRUD type name
57     */
58    public void setType(String type) {
59      this.type = type;
60    }
61  
62    @Override
63    public int hashCode() {
64      int result = 0;
65      result = 31 * result + super.hashCode();
66      result = 31 * result + (getType() != null ? getType().hashCode() : 0);
67      return result;
68    }
69  
70    @Override
71    public String toString() {
72      StringBuilder str = new StringBuilder();
73      str.append(super.toString());
74      str.append("type = " + getType() + "\n");
75      return str.toString();
76    }
77  
78    @Override
79    public boolean equals(Object o) {
80      if (this == o) return true;
81  
82      if (o == null || getClass() != o.getClass()) return false;
83  
84      CpoFunctionGroupBean that = (CpoFunctionGroupBean) o;
85  
86      if (!super.equals(that)) return false;
87  
88      return getType() != null ? getType().equals(that.getType()) : that.getType() == null;
89    }
90  }