-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from InseeFr/refactor_fileIdCard
Refactor file id card
- Loading branch information
Showing
44 changed files
with
1,703 additions
and
824 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 35 additions & 35 deletions
70
arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/factory/TypeChargement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
package fr.insee.arc.core.service.p2chargement.factory; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import fr.insee.arc.utils.exception.ArcException; | ||
import fr.insee.arc.utils.exception.ArcExceptionMessage; | ||
|
||
public enum TypeChargement { | ||
CLEF_VALEUR("clef-valeur"), | ||
XML("xml"), | ||
PLAT("plat"), | ||
XML_COMPLEXE("xml-complexe"); | ||
|
||
private String nom; | ||
|
||
private TypeChargement(String nom) { | ||
this.nom = nom; | ||
} | ||
|
||
public String getNom() { | ||
return nom; | ||
} | ||
|
||
public void setNom(String nom) { | ||
this.nom = nom; | ||
} | ||
|
||
public static TypeChargement getEnum(String code) { | ||
|
||
switch (code) { | ||
case "clef-valeur": | ||
return CLEF_VALEUR; | ||
case "xml": | ||
return XML; | ||
case "plat": | ||
return PLAT; | ||
case "xml-complexe": | ||
return XML_COMPLEXE; | ||
default: | ||
return null; | ||
} | ||
} | ||
|
||
CLEF_VALEUR("clef-valeur"), XML("xml"), PLAT("plat"), XML_COMPLEXE("xml-complexe"); | ||
|
||
private String nom; | ||
|
||
private TypeChargement(String nom) { | ||
this.nom = nom; | ||
} | ||
|
||
public String getNom() { | ||
return nom; | ||
} | ||
|
||
public void setNom(String nom) { | ||
this.nom = nom; | ||
} | ||
|
||
public static TypeChargement getEnum(String code) throws ArcException { | ||
|
||
List<TypeChargement> filtered = Arrays.asList(TypeChargement.values()).stream() | ||
.filter(t -> t.getNom().equals(code)).collect(Collectors.toList()); | ||
|
||
if (filtered.isEmpty()) { | ||
throw new ArcException(ArcExceptionMessage.LOAD_TYPE_NOT_FOUND, code); | ||
} | ||
|
||
return filtered.get(0); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.