java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Konfigurace.java
author František Kučera <franta-hg@frantovo.cz>
Fri, 15 Dec 2023 01:36:17 +0100
branchv_0
changeset 31 1ab5ce94a146
permissions -rw-r--r--
konfigurace, parser CLI parametrů
     1 /**
     2  * Rozšířené atributy – program na správu rozšířených atributů souborů
     3  * Copyright © 2023 František Kučera (frantovo.cz)
     4  *
     5  * This program is free software: you can redistribute it and/or modify
     6  * it under the terms of the GNU General Public License as published by
     7  * the Free Software Foundation, either version 3 of the License.
     8  *
     9  * This program is distributed in the hope that it will be useful,
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12  * GNU General Public License for more details.
    13  *
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    16  */
    17 package cz.frantovo.rozsireneatributy;
    18 
    19 import java.io.File;
    20 import java.util.LinkedList;
    21 import java.util.List;
    22 
    23 /**
    24  * @author Ing. František Kučera (frantovo.cz)
    25  */
    26 public class Konfigurace {
    27 
    28 	public static class DefiniceAtributu {
    29 
    30 		private String název;
    31 		private String popis;
    32 		private final List<DefiniceHodnoty> hodnoty = new LinkedList<>();
    33 
    34 		public DefiniceAtributu(String název, String popis) {
    35 			this.název = název;
    36 			this.popis = popis;
    37 		}
    38 
    39 		public String getNázev() {
    40 			return název;
    41 		}
    42 
    43 		public void setNázev(String název) {
    44 			this.název = název;
    45 		}
    46 
    47 		public String getPopis() {
    48 			return popis;
    49 		}
    50 
    51 		public void setPopis(String popis) {
    52 			this.popis = popis;
    53 		}
    54 
    55 		public List<DefiniceHodnoty> getHodnoty() {
    56 			return hodnoty;
    57 		}
    58 
    59 		public void addHodnota(DefiniceHodnoty hodnota) {
    60 			this.hodnoty.add(hodnota);
    61 		}
    62 
    63 	}
    64 
    65 	public static class DefiniceHodnoty {
    66 
    67 		private String název;
    68 		private String popis;
    69 
    70 		public DefiniceHodnoty(String název, String popis) {
    71 			this.název = název;
    72 			this.popis = popis;
    73 		}
    74 
    75 		public String getNázev() {
    76 			return název;
    77 		}
    78 
    79 		public void setNázev(String název) {
    80 			this.název = název;
    81 		}
    82 
    83 		public String getPopis() {
    84 			return popis;
    85 		}
    86 
    87 		public void setPopis(String popis) {
    88 			this.popis = popis;
    89 		}
    90 	}
    91 
    92 	private File soubor;
    93 
    94 	private boolean povinnéZamykání = false;
    95 
    96 	private final List<DefiniceAtributu> atributy = new LinkedList<>();
    97 
    98 	public File getSoubor() {
    99 		return soubor;
   100 	}
   101 
   102 	public void setSoubor(File soubor) {
   103 		this.soubor = soubor;
   104 	}
   105 
   106 	public boolean isPovinnéZamykání() {
   107 		return povinnéZamykání;
   108 	}
   109 
   110 	public void setPovinnéZamykání(boolean povinnéZamykání) {
   111 		this.povinnéZamykání = povinnéZamykání;
   112 	}
   113 
   114 	public List<DefiniceAtributu> getAtributy() {
   115 		return atributy;
   116 	}
   117 
   118 	public void addAtribut(DefiniceAtributu atribut) {
   119 		this.atributy.add(atribut);
   120 	}
   121 
   122 }