diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2018-09-28 14:19:50 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2018-09-28 14:19:50 +0200 |
commit | b76b6e6212784d622ca79bd258fa3e529b353346 (patch) | |
tree | fc1a83b6775e043aaabaa88648fc20063e938948 /id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/natural/MaritalStateAttributeValueMarshaller.java | |
parent | 5a147ba2714436e5fb15ddcf3db8df6273ac4d57 (diff) | |
download | moa-id-spss-b76b6e6212784d622ca79bd258fa3e529b353346.tar.gz moa-id-spss-b76b6e6212784d622ca79bd258fa3e529b353346.tar.bz2 moa-id-spss-b76b6e6212784d622ca79bd258fa3e529b353346.zip |
add first code for eID4U
Diffstat (limited to 'id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/natural/MaritalStateAttributeValueMarshaller.java')
-rw-r--r-- | id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/natural/MaritalStateAttributeValueMarshaller.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/natural/MaritalStateAttributeValueMarshaller.java b/id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/natural/MaritalStateAttributeValueMarshaller.java new file mode 100644 index 000000000..afa8d4d06 --- /dev/null +++ b/id/server/modules/eID4UExtensions/src/main/java/at/gv/egiz/eid4u/impl/attributes/natural/MaritalStateAttributeValueMarshaller.java @@ -0,0 +1,26 @@ +package at.gv.egiz.eid4u.impl.attributes.natural; + +import at.gv.egiz.eid4u.api.attributes.natural.MaritalState; +import eu.eidas.auth.commons.attribute.AttributeValue; +import eu.eidas.auth.commons.attribute.AttributeValueMarshaller; +import eu.eidas.auth.commons.attribute.AttributeValueMarshallingException; + +public final class MaritalStateAttributeValueMarshaller implements AttributeValueMarshaller<MaritalState> { + + @Override + public String marshal(AttributeValue<MaritalState> value) throws AttributeValueMarshallingException { + return value.getValue().getValue(); + + } + + @Override + public AttributeValue<MaritalState> unmarshal(String value, boolean isNonLatinScriptAlternateVersion) + throws AttributeValueMarshallingException { + MaritalState idType = MaritalState.fromString(value); + if (null == idType) { + throw new AttributeValueMarshallingException("Illegal MaritalState value \"" + value + "\""); + } + return new MaritalStateAttributeValue(idType); + } + +} |