UpdateField.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */
  20. package org.openspcoop2.generic_project.beans;

  21. import org.openspcoop2.generic_project.exception.ServiceException;

  22. /**
  23.  * UpdateField
  24.  *
  25.  * @author Andrea Poli (apoli@link.it)
  26.  * @author $Author$
  27.  * @version $Rev$, $Date$
  28.  */
  29. public class UpdateField {

  30.     private IField field;
  31.     private Object value;

  32.     // Un aggiornamento potrebbe rendere null un campo, per questo il valore può essere null
  33.    
  34.     public UpdateField(IField field) throws ServiceException{
  35.         this(field, null);
  36.     }
  37.     public UpdateField(IField field, Object value) throws ServiceException{
  38.         this.setField(field);
  39.         this.setValue(value);
  40.     }
  41.    
  42.     public IField getField() {
  43.         return this.field;
  44.     }
  45.     public void setField(IField field) throws ServiceException {
  46.         if(field==null){
  47.             throw new ServiceException("Param field not defined");
  48.         }
  49.         this.field = field;
  50.     }
  51.     public Object getValue() {
  52.         return this.value;
  53.     }
  54.     public void setValue(Object value) {
  55.         this.value = value;
  56.     }
  57. }