-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/mosip/resident-services …
…into develop
- Loading branch information
Showing
5 changed files
with
52 additions
and
63 deletions.
There are no files selected for viewing
35 changes: 21 additions & 14 deletions
35
resident/resident-service/src/main/java/io/mosip/resident/constant/AttributeNameEnum.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,32 +1,39 @@ | ||
package io.mosip.resident.constant; | ||
|
||
import org.springframework.core.env.Environment; | ||
|
||
/** | ||
* @author Kamesh Shekhar Prasad | ||
*/ | ||
public enum AttributeNameEnum { | ||
FULL_NAME("fullName", "mosip.full.name.template.property"), | ||
DATE_OF_BIRTH("dateOfBirth", "mosip.date.of.birth.template.property"), | ||
UIN("UIN", "mosip.uin.template.property"), | ||
PERPETUAL_VID("perpetualVID", "mosip.perpetual.vid.template.property"), | ||
PHONE("phone", "mosip.phone.template.property"), | ||
EMAIL("email", "mosip.email.template.property"), | ||
ADDRESS("addressLine1", "mosip.address.template.property"), | ||
GENDER("gender", "mosip.gender.template.property"), | ||
DEFAULT("Default", "mosip.defualt.template.property"); | ||
FULL_NAME("fullName", "mosip.full.name.template.property.attribute.list"), | ||
DATE_OF_BIRTH("dateOfBirth", "mosip.date.of.birth.template.property.attribute.list"), | ||
UIN("UIN", "mosip.uin.template.property.attribute.list"), | ||
PERPETUAL_VID("perpetualVID", "mosip.perpetual.vid.template.property.attribute.list"), | ||
PHONE("phone", "mosip.phone.template.property.attribute.list"), | ||
EMAIL("email", "mosip.email.template.property.attribute.list"), | ||
ADDRESS("addressLine1", "mosip.address.template.property.attribute.list"), | ||
PROVINCE("province", "mosip.province.template.property.attribute.list"), | ||
CITY("city", "mosip.city.template.property.attribute.list"), | ||
ZONE("zone", "mosip.zone.template.property.attribute.list"), | ||
POSTAL_CODE("postalCode", "mosip.postal.code.template.property.attribute.list"), | ||
REGION("region", "mosip.region.template.property.attribute.list"), | ||
GENDER("gender", "mosip.gender.template.property.attribute.list"), | ||
DEFAULT("Default", "mosip.defualt.template.property.attribute.list"); | ||
private String attributeValue; | ||
private String templatePropertyName; | ||
AttributeNameEnum(String name, String templatePropertyName){ | ||
this.attributeValue = name; | ||
this.templatePropertyName = templatePropertyName; | ||
} | ||
|
||
public static String getTemplatePropertyName(String attributeName) { | ||
for (AttributeNameEnum authenticationModeEnum : values()) { | ||
if (authenticationModeEnum.attributeValue.equalsIgnoreCase(attributeName)) { | ||
return authenticationModeEnum.templatePropertyName; | ||
public static String getTemplatePropertyName(String attributeName, Environment env) { | ||
for (AttributeNameEnum attributeNameEnum : values()) { | ||
if (attributeNameEnum.attributeValue.equalsIgnoreCase(attributeName)) { | ||
return env.getProperty(attributeNameEnum.templatePropertyName); | ||
} | ||
} | ||
return AttributeNameEnum.DEFAULT.templatePropertyName; | ||
return env.getProperty(AttributeNameEnum.DEFAULT.templatePropertyName); | ||
} | ||
|
||
} |
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