CausalePagamentoType.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 it.gov.fatturapa.sdi.fatturapa.v1_1.constants;

  21. import java.io.Serializable;
  22. import java.util.List;

  23. import org.openspcoop2.generic_project.beans.IEnumeration;
  24. import org.openspcoop2.generic_project.exception.NotFoundException;

  25. /**    
  26.  * Enumeration dell'elemento CausalePagamentoType xsd (tipo:string)
  27.  *
  28.  * @author Poli Andrea (poli@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  */
  32. @javax.xml.bind.annotation.XmlType(name = "CausalePagamentoType")
  33. @javax.xml.bind.annotation.XmlEnum(String.class)
  34. public enum CausalePagamentoType implements IEnumeration , Serializable , Cloneable {

  35.     @javax.xml.bind.annotation.XmlEnumValue("A")
  36.     A ("A"),
  37.     @javax.xml.bind.annotation.XmlEnumValue("B")
  38.     B ("B"),
  39.     @javax.xml.bind.annotation.XmlEnumValue("C")
  40.     C ("C"),
  41.     @javax.xml.bind.annotation.XmlEnumValue("D")
  42.     D ("D"),
  43.     @javax.xml.bind.annotation.XmlEnumValue("E")
  44.     E ("E"),
  45.     @javax.xml.bind.annotation.XmlEnumValue("G")
  46.     G ("G"),
  47.     @javax.xml.bind.annotation.XmlEnumValue("H")
  48.     H ("H"),
  49.     @javax.xml.bind.annotation.XmlEnumValue("I")
  50.     I ("I"),
  51.     @javax.xml.bind.annotation.XmlEnumValue("L")
  52.     L ("L"),
  53.     @javax.xml.bind.annotation.XmlEnumValue("M")
  54.     M ("M"),
  55.     @javax.xml.bind.annotation.XmlEnumValue("N")
  56.     N ("N"),
  57.     @javax.xml.bind.annotation.XmlEnumValue("O")
  58.     O ("O"),
  59.     @javax.xml.bind.annotation.XmlEnumValue("P")
  60.     P ("P"),
  61.     @javax.xml.bind.annotation.XmlEnumValue("Q")
  62.     Q ("Q"),
  63.     @javax.xml.bind.annotation.XmlEnumValue("R")
  64.     R ("R"),
  65.     @javax.xml.bind.annotation.XmlEnumValue("S")
  66.     S ("S"),
  67.     @javax.xml.bind.annotation.XmlEnumValue("T")
  68.     T ("T"),
  69.     @javax.xml.bind.annotation.XmlEnumValue("U")
  70.     U ("U"),
  71.     @javax.xml.bind.annotation.XmlEnumValue("V")
  72.     V ("V"),
  73.     @javax.xml.bind.annotation.XmlEnumValue("W")
  74.     W ("W"),
  75.     @javax.xml.bind.annotation.XmlEnumValue("X")
  76.     X ("X"),
  77.     @javax.xml.bind.annotation.XmlEnumValue("Y")
  78.     Y ("Y"),
  79.     @javax.xml.bind.annotation.XmlEnumValue("Z")
  80.     Z ("Z"),
  81.     @javax.xml.bind.annotation.XmlEnumValue("L1")
  82.     L1 ("L1"),
  83.     @javax.xml.bind.annotation.XmlEnumValue("M1")
  84.     M1 ("M1"),
  85.     @javax.xml.bind.annotation.XmlEnumValue("O1")
  86.     O1 ("O1"),
  87.     @javax.xml.bind.annotation.XmlEnumValue("V1")
  88.     V1 ("V1");
  89.    
  90.    
  91.     /** Value */
  92.     private String value;
  93.     @Override
  94.     public String getValue()
  95.     {
  96.         return this.value;
  97.     }


  98.     /** Official Constructor */
  99.     CausalePagamentoType(String value)
  100.     {
  101.         this.value = value;
  102.     }


  103.    
  104.     @Override
  105.     public String toString(){
  106.         return this.value;
  107.     }
  108.     public boolean equals(String object){
  109.         if(object==null)
  110.             return false;
  111.         return object.equals(this.getValue());  
  112.     }
  113.    
  114.        
  115.    
  116.     /** compatibility with the generated bean (reflection) */
  117.     public boolean equals(Object object,List<String> fieldsNotCheck){
  118.         if( !(object instanceof CausalePagamentoType) ){
  119.             java.lang.StringBuilder sb = new java.lang.StringBuilder();
  120.             if(fieldsNotCheck!=null && !fieldsNotCheck.isEmpty()){
  121.                 sb.append(" (fieldsNotCheck: ").append(fieldsNotCheck).append(")");
  122.             }
  123.             throw new org.openspcoop2.utils.UtilsRuntimeException("Wrong type"+sb.toString()+": "+object.getClass().getName());
  124.         }
  125.         return this.equals(object);
  126.     }
  127.     private String toStringEngine(Object object,boolean reportHTML,List<String> fieldsNotIncluded, StringBuilder bf){
  128.         java.lang.StringBuilder sb = new java.lang.StringBuilder();
  129.         if(reportHTML){
  130.             sb.append(" (reportHTML)");
  131.         }
  132.         if(fieldsNotIncluded!=null && !fieldsNotIncluded.isEmpty()){
  133.             sb.append(" (fieldsNotIncluded: ").append(fieldsNotIncluded).append(")");
  134.         }
  135.         if(object!=null){
  136.             sb.append(" (object: ").append(object.getClass().getName()).append(")");
  137.         }
  138.         if(sb.length()>0) {
  139.             bf.append(sb.toString());
  140.         }
  141.         return sb.length()>0 ? this.toString()+sb.toString() : this.toString();
  142.     }
  143.     public String toString(boolean reportHTML){
  144.         return toStringEngine(null, reportHTML, null, null);
  145.     }
  146.     public String toString(boolean reportHTML,List<String> fieldsNotIncluded){
  147.         return toStringEngine(null, reportHTML, fieldsNotIncluded, null);
  148.     }
  149.     public String diff(Object object,StringBuilder bf,boolean reportHTML){
  150.         return toStringEngine(object, reportHTML, null, bf);
  151.     }
  152.     public String diff(Object object,StringBuilder bf,boolean reportHTML,List<String> fieldsNotIncluded){
  153.         return toStringEngine(object, reportHTML, fieldsNotIncluded, bf);
  154.     }
  155.    
  156.    
  157.     /** Utilities */
  158.    
  159.     public static String[] toArray(){
  160.         String[] res = new String[values().length];
  161.         int i=0;
  162.         for (CausalePagamentoType tmp : values()) {
  163.             res[i]=tmp.getValue();
  164.             i++;
  165.         }
  166.         return res;
  167.     }  
  168.     public static String[] toStringArray(){
  169.         String[] res = new String[values().length];
  170.         int i=0;
  171.         for (CausalePagamentoType tmp : values()) {
  172.             res[i]=tmp.toString();
  173.             i++;
  174.         }
  175.         return res;
  176.     }
  177.     public static String[] toEnumNameArray(){
  178.         String[] res = new String[values().length];
  179.         int i=0;
  180.         for (CausalePagamentoType tmp : values()) {
  181.             res[i]=tmp.name();
  182.             i++;
  183.         }
  184.         return res;
  185.     }
  186.    
  187.     public static boolean contains(String value){
  188.         return toEnumConstant(value)!=null;
  189.     }
  190.    
  191.     public static CausalePagamentoType toEnumConstant(String value){
  192.         try{
  193.             return toEnumConstant(value,false);
  194.         }catch(NotFoundException notFound){
  195.             return null;
  196.         }
  197.     }
  198.     public static CausalePagamentoType toEnumConstant(String value, boolean throwNotFoundException) throws NotFoundException{
  199.         CausalePagamentoType res = null;
  200.         for (CausalePagamentoType tmp : values()) {
  201.             if(tmp.getValue().equals(value)){
  202.                 res = tmp;
  203.                 break;
  204.             }
  205.         }
  206.         if(res==null && throwNotFoundException){
  207.             throw new NotFoundException("Enum with value ["+value+"] not found");
  208.         }
  209.         return res;
  210.     }
  211.    
  212.     public static IEnumeration toEnumConstantFromString(String value){
  213.         try{
  214.             return toEnumConstantFromString(value,false);
  215.         }catch(NotFoundException notFound){
  216.             return null;
  217.         }
  218.     }
  219.     public static IEnumeration toEnumConstantFromString(String value, boolean throwNotFoundException) throws NotFoundException{
  220.         CausalePagamentoType res = null;
  221.         for (CausalePagamentoType tmp : values()) {
  222.             if(tmp.toString().equals(value)){
  223.                 res = tmp;
  224.                 break;
  225.             }
  226.         }
  227.         if(res==null && throwNotFoundException){
  228.             throw new NotFoundException("Enum with value ["+value+"] not found");
  229.         }
  230.         return res;
  231.     }
  232. }